Map generation via PHP (and a question)
[Please post markup tags between backticks or use the code button. As it stands, your post may now have been permanently damaged/corrupted by the forum’s parser.]
Love this plugin; it does 99% of all that I need, and I’ve found it super simple to inject into my site.
For those of you seeking a way to programmatically generate a map via PHP, here’s the flow I follow to make it so:
— create a template file (and a page that uses that template)
— in that file, use PHP of the form
where moof() is a function that returns a well-formed shortcode string, in the syntax you’d see if using the shortcode builder from this plugin. You’ll want to put that statement in the context of whatever other layout you have for that page. In my function, I’m drawing from a custom taxonomy to generate a list of locations for the map.
When that page is requested, the function generates the proper shortcode, do_shortcode activates the appropriate handler to expand the shortcode, and then all is delivered back to the client (whereupon the dynamically created map is rendered).
Now, here’s the question – or perhaps it’s a request for a new feature. I’d like to provide a description for each of those locations that’s actually a link (in my case, a link back to a particular set of posts). Alas, the plugin munches any html in any description text I enter (e.g. something like
<a href='mumble.com'>causes the plugin to complain when rendering…it doesn’t like the quotes inside the href).
I am confident I can hack this in the plugin code (but I’d rather not, for I’ll have to recreate those changes anytime the plugin is updated.
So, the request: could you provide an out-of-the-box way for the plugin to accept location descriptions that include links?
- The topic ‘Map generation via PHP (and a question)’ is closed to new replies.