Sauter la navigation

[Résolu] Shortcode “Allow multiple instances of this field”

Ce fil est résolu. Voici une description du problème et la solution proposée.

Problem:
The user was not able to display a field that accepts multiple instances.

Solution:
The field's slug inside the wpv-for-each shortcode needs to be the actuall slug in the database. Toolset fields are saved on the database prefixed by 'wpcf-'. I fixed the shortcode and it is now working, check this screenshot http://prntscr.com/tr9q2d

[wpv-for-each field="wpcf-shortcode-questionari"]
<div>[qsm quiz='[types field="shortcode-questionari"][/types]']</div>
[/wpv-for-each]

Relevant Documentation:
https://toolset.com/documentation/programmer-reference/views/views-shortcodes/

100% of people find this useful.

This support ticket is created Il y a 4 années et 4 mois. 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 – 13:00 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 - - 9:00 – 13:00
14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 - - 14:00 – 18:00

Supporter timezone: Africa/Casablanca (GMT+01:00)

Marqué : 

Ce sujet contient 3 réponses, a 2 voix.

Dernière mise à jour par Rafael Corts Il y a 4 années et 4 mois.

Assisté par: Jamal.

Auteur
Publications
#1721423
fotograma-1.jpg

Good morning Christian,
I have a plugin that uses the following shortcode: [qsm quiz=20] and I need to save it in a “single lines” in a Post Type field. I keep the code, and when I change the number (20) it works correcltly. Nevertheless, when I’apply it in the “Single line” field into Allow multiple instances I don’t know how to do it.
Here I show you what I have by now:

<div class="rc_seccio_ques">
    <h3>Qüestionari</h3>
    <div> [qsm quiz=[types field='shortcode-questionari' separator=','][/types]]</div>
</div> 

Thankyou

Rafa Corts

#1721727

Hello Rafa and thank you for contacting the Toolset support. I hope you don't see an inconvenience if I work with you on this ticket!

The Toolset Types shortcode used will return "5,20" for the example in the screenshot. I do not think that the qsm shortcode expects an argument value like that.
I suggest using the wpv-for-each shortcode to iterate throw the values of the field. Something like this should work:

[wpv-for-each field="shortcode-questionari"]
<div>[qsm quiz="[types field="shortcode-questionari"][/types]"]</div>
[/wpv-for-each]

I hope this helps. Otherwise, please allow me temporary access to check it closely. Your next reply will be private to let you share credentials safely. ** Make a database backup before sharing credentials. **

#1723043

Hello Rafa and my apologies for the mistake.

The field's slug inside the wpv-for-each shortcode needs to be the actuall slug in the database. Toolset fields are saved on the database prefixed by 'wpcf-'. I fixed the shortcode and it is now working, check this screenshot lien caché

[wpv-for-each field="wpcf-shortcode-questionari"]
<div>[qsm quiz='[types field="shortcode-questionari"][/types]']</div>
[/wpv-for-each]
#1723465

My issue is resolved now. Thank you!