POI List Template: Call from Custom Field

Home Forums MapPress Support POI List Template: Call from Custom Field

Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #10140
    Law4elders
    Participant

    Hi,

    I’m editing my POI List template file. I’d like to edit the poi list to show phone numbers and the facility type that I have listed in my custom fields.

    The two custom fields are wpcf-facility-type and wpcf-phone.  What php would i add to my template to accomplish this?

    #10175
    Law4elders
    Participant

    Hello,

    I’ve been going through trial and error and still am having a difficult time with this. After seeing the new updates I figured this format would be much easier to implement than the original request to just use the link separate from the marker list.

    #10179
    Chris
    Keymaster

    Hi,

    The release notes are very skimpy.  I’ll try to get the beta documentation done ASAP so you can see some examples.

    Basically, you can copy the ‘map-poi-list.php’ template file to your theme directory and then edit it, much like a regular blog template file.  It sounds like you’ve already done that.

    Then, assuming you’re using the default table layout, you could add the two columns like so:

    <?php if ($poi->postid): ?>
    	<td>   
    		<?php echo get_post_meta($poi->postid, 'wpcf-facility', true); ?>
    	</td>
    	<td>
    		<?php echo get_post_meta($poi->postid, 'wpcf-phone', true); ?>
    	</td>
    <?php endif; ?>

    If you like, send me an email and I’ll reply with the entire file.

    #10217
    Law4elders
    Participant

    Okay,  I tried it out and my fields were uneven and the facility type did not show. Could you send me the file please?

    #10228
    Chris
    Keymaster

    Hi, you just need to add a column header (a <th> tag) for each column and adjust the column widths.  I’ve emailed you a complete file.

Viewing 5 posts - 1 through 5 (of 5 total)
  • You must be logged in to reply to this topic.