Skip Navigation

[Resolved] Inserting a custom fied value in a child view call for filtering

This support ticket is created 2 years, 7 months ago. There's a good chance that you are reading advice that it now obsolete.

This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.

Sun Mon Tue Wed Thu Fri Sat
- 9:00 – 12:00 9:00 – 12:00 9:00 – 12:00 9:00 – 12:00 9:00 – 12:00 -
- 13:00 – 18:00 13:00 – 18:00 13:00 – 18:00 14:00 – 18:00 13:00 – 18:00 -

Supporter timezone: America/Jamaica (GMT-05:00)

This topic contains 6 replies, has 2 voices.

Last updated by francisS 2 years, 7 months ago.

Assisted by: Shane.

Author
Posts
#2360825

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 ?

#2360869

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

#2360911
toolset-view-mesures.jpg

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

#2360921

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 ).

#2361033

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

#2361035

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

#2361037

My issue is resolved now. Thank you for support !