Hi,
I have 2 types :
- Mouvements (which are watches mechanisms)
- Mesures (which are mesureaments related to Mouvements - 1 to 0-1 relation)
I have a Model for displaying Mouvements, example :
hidden link
and in the "MESURES FRANCÉCLAT" tab, I call a view to display the related Mesures.
My problem : how to insert the parameter (Id of the Mesures) in the view calling ?
I've tried this :
[types field='identifiant-mesure'][/types]
=> gives me the good id
[wpv-view name="mesures" mesure="[wpv-post-field name="identifiant-mesure"]" order="asc"]
=> gives me
<!- Vue introuvable ->" order="asc"]
[wpv-view name="mesures" mesure="[types field='identifiant-mesure'][/types]" order="asc"]
=> gives me a result but for Id=1 not 286
{!{wpv-view name='mesures' mesure='296' order='asc'}!}
=> gives me the results excepted... for this watch but allways the same, for any others watches
How do I put my value in the [wpv-view] mesure parameter without breaking the code ?
I'm surely stupid but I'm on this problem since yesterday morning !..
Can you please, help me ?
Shane
Supporter
Languages:
English (English )
Timezone:
America/Jamaica (GMT-05:00)
Hi Francis,
Thank you for getting in touch.
The problem with the shortcode below is with the quotes used for the parameter.
[wpv-view name="mesures" mesure="[wpv-post-field name="identifiant-mesure"]" order="asc"]
To fix this you will need to use single quotes inside the wpv-post-field shortcode like below.
[wpv-view name="mesures" mesure="[wpv-post-field name='identifiant-mesure']" order="asc"]
This should now resolve the issue.
Thanks,
Shane
Hi,
Thank you for your answer but, unfortunately, it doesn't work.
As [wpv-post-field name='wpcf- identifiant-mesure'] gives me the right value (296) for the Mouvement
I've tried :
[wpv-view name="mesures" mesure="[wpv-post-field name='wpcf-identifiant-mesure']" order="asc"][/wpv-view]
{!{wpv-view name="mesures" mesure="[wpv-post-field name='wpcf-identifiant-mesure']" order="asc"}!}
{!{wpv-view name="mesures" mesure="{!{wpv-post-field name='wpcf-identifiant-mesure'}!}"}!}
without success
You can see the result at hidden link , on the "test" tab
Also a JPG screenshot of the source code of the tab
I guess the inner shortcode (to get the value of the custom field wpcf-identifiant-mesure is not (correctly ?) executed inside the wpv-view shortcode.
I've already use this method on a previous website, without problem
=> [wpv-view name="Revues-Editeur" idediteur="[wpv-post-field name="IDEditeur"]" order="asc"]
(I've already tried this syntax on mvtfs.projets-web.net without success ).
Shane
Supporter
Languages:
English (English )
Timezone:
America/Jamaica (GMT-05:00)
Hi Francis,
In some cases your template builder may not support the nesting of shortcode.
I know if you're using a Toolset Content template then the shortcode below will work with no issues at all.
[wpv-view name="mesures" mesure="[wpv-post-field name='wpcf-identifiant-mesure']" order="asc"]
I see you're using an HTML block to add the shortcode. Does this template builder have a WYSIWYG editor that you can use instead of the HTML block ?
Please try this and let me know.
Thanks,
Shane
Shane,
You saved me... I love you !
WYSIWYG block was the solution. 2 days lost just for that, it's crazy.
Thanks a lot
Francis
My issue is resolved now. Thank you for support !