Forum Replies Created
-
AuthorPosts
-
May 8, 2025 at 11:32 PM in reply to: ✅How to create a View to show an Open Street Map containing all markers #48210
JonS
ParticipantFantastic. That was the missing piece I needed. Thanks Peter, you're a star.
May 8, 2025 at 8:39 PM in reply to: ✅How to create a View to show an Open Street Map containing all markers #48202JonS
ParticipantThanks to Peter for sorting me out with this.
One other quick thing I'm struggling with.
The tooltip popup shows the title and address (perfect) but I also want to show a link to the single page for that location.
What is the variable I should be calling...
location_on_map.url (url is wrong, what should it be?)
I hope that makes sense.
One last thing... can I stop the first location's tooltip from automatically showing? I just want to show the markers on the map and then, when one is clicked, have the tooltip appear which includes a link to that location.
Many thanks in anticipation.
March 25, 2025 at 11:07 PM in reply to: ✅How to create a View to show an Open Street Map containing all markers #47916JonS
ParticipantThanks Peter.
I've set you up with an admin login and sent the details via the contact form.
All the best
Jon
March 24, 2025 at 9:57 PM in reply to: ✅How to create a View to show an Open Street Map containing all markers #47908JonS
ParticipantThanks for your reply, Peter. That is the tutorial I've gone through in great detail multiple times but I just get a blank area where the map should be shown. I've set it all to use the custom post type I created. The field is all working fine. It should be so simple to have a map showing the markers but there's nothing.
October 18, 2021 at 7:24 PM in reply to: ✅How can I show a map marker using OSM on a custom field in a custom taxonomy #31376JonS
ParticipantFantastic. I think the bit I was missing was the object_type. Working perfectly.
Many thanks for the speedy response.
JonS
ParticipantThat worked perfectly. Thanks for that.
JonS
ParticipantSorted it. The url should be
{{ post.post_name }}.JonS
ParticipantI'm almost there. The title should be referenced with
{{ post.post_title }}but I don't know what the url should be.JonS
ParticipantMy view is now like this:
{% set args = { post_type: 'fixture', posts_per_page: -1, orderby: 'fixture_date_and_time', order: 'ASC' } %} <table> <thead align="left"> <th>Event</th> <th>Date / Time</th> <th>Venue</th> <th>Age Group</th> </thead> {% set my_posts = mb.get_posts( args ) %} {% for post in my_posts %} <tr> <td><a href="{{ post.url }}">{{ post.title }}</a></td> <td><a href="{{ post.url }}">{{ post.fixture_date_and_time | date( 'D j M, Y \\a\\t h:i A' ) }}</a></td> <td>{{ mb.get_the_term_list( post.ID, 'fixture-venue', '', ', ' ) }}</td> <td>{{ mb.get_the_term_list( post.ID, 'fixture-age-group', '', ', ' ) }}</td> </tr> {% endfor %} </table>The URL isn't working, either, so it seems to be the built-in WP fields that don't work but the MB custom fields do.
JonS
ParticipantBrilliant. That makes perfect sense. It's now working as it should except for one thing.
The {{ post.title }} is blank. The other fields are displaying perfectly. I would have thought the title was the easiest part so am somewhat confused!
JonS
ParticipantFollowing up on this, I've also put the shortcode onto another page and it's just showing the data from that page, not the custom post 'fixture' so the code seems to be doing nothing.
JonS
ParticipantThanks for your reply. I've followed all the information but it just isn't making any difference to the order on on the page.
This is the code in my MB View which is set as a Shortcode type and I'm putting that shortcode into the archive template:
{% set args = { post_type: 'fixture', posts_per_page: -1, orderby: 'fixture_date_and_time', order: 'ASC', meta_key: 'fixture_date_and_time' } %} {% set posts = mb.get_posts( args ) %} <table> <thead align="left"> <th>Event</th> <th>Date / Time</th> <th>Venue</th> <th>Age Group</th> </thead> {% for post in query.posts %} <tr> <td><a href="{{ post.url }}">{{ post.title }}</a></td> <td><a href="{{ post.url }}">{{ post.fixture_date_and_time | date( 'D M j, Y h:i A' ) }}</a></td> <td>{{ mb.get_the_term_list( post.ID, 'fixture-venue', '', ', ' ) }}</td> <td>{{ mb.get_the_term_list( post.ID, 'fixture-age-group', '', ', ' ) }}</td> </tr> {% endfor %} </table>I'm changing the order from ASC to DESC and it's making no difference.
What am I doing wrong?
JonS
ParticipantThis looks like exactly what I need. Where did you put that line of code?
JonS
ParticipantThat's brilliant. What a great plugin. This has almost completely solved my issue.
I also have a button which should link to a custom post where a PDF has been uploaded but the field doesn't appear when I click to add a dynamic field and select Meta Box.
-
AuthorPosts