Tell us what you are trying to do?
I am trying to get the views output to be recognized as a shortcode and not as formatted text.
I am using leaflet maps and it works perfectly when I manually enter the shortcodes. (As seen in this link here: hidden link ).
When I try and get the views output to work as shortcodes it doesn't work (as seen here: hidden link )
Can you provide any insight on a method that will make this work?
Thanks,
Cam
What is the link to your site?
hidden link
Looking at the markup on your failing example (screenshot), the shortcodes are not correctly formed, instead of a url for the gpx attribute they contain a link and that link uses the same double-quotes for its href attribute as wraps the gpx attribute, hence breaking the shortcode.
So, however you are creating this shorcode, you need to output the raw url rather than a link, and you need to avoid using the same quotes. (But if you output the url as a url and not a link, that problem will likely disappear.)
Hello Nigel,
It is still not working. I created a new view: hidden link
There is no link now and the shortcode is still not working.
Please Advise,
Cam
Hi Cameron,
Would you mind allowing us to have admin access to the site so as to look more closely at this issue for you ?
I've enabled the private fields for your next response.
Thanks,
Shane
Hi Cameron,
This should now be working.
The problem was that your shortcode was formatted incorrectly as nigel mentioned. What you had was this below.
[elevation gpx="[wpv-post-body view_template="loop-item-in-gpx"]"]<br>
You were passing the entire content template for the view into the shortcode and note that instead of the square brackets, the ascii code for the shortcode is being used.
What I did was to call the Types shortcode directly rather than using the content template. The new format is now this below.
[elevation gpx="[types field='gpx-track' output='raw'][/types]"]
Please let me know if everything is ok now.
Thanks,
Shane
Thanks Shane, That Works perfectly.
For some reason the view is outputing this:
[elevation 0=gpx= ]
[elevation 0=gpx= ]
I'm assuming it is null fields from past posts (as seen here: hidden link )
Do you know how I can try and get around that? I tried putting a condition on it that the field wasn't full, but I'm assuming I didn't do it correctly.
Thanks,
Cam
Hi Cameron,
I see where GPX track is a repeatable field group. In this case we're going to have to set things up a little differently.
I've now modified your GPX view to display the nested repeatable field group view to display the correct GPX track according to the post that is being displayed by the view.
hidden link
The view below displays the repeatable field group.
hidden link
Also there is a conditional added that will only allow fields that have values to be displayed.
Please let me know if everything is ok now.
Thanks,
Shane
Thanks Shane, your solution works perfectly!