Skip Navigation

[Resolved] Shortcode “Allow multiple instances of this field”

This thread is resolved. Here is a description of the problem and solution.

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/

This support ticket is created 3 years, 9 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 – 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)

Tagged: 

This topic contains 3 replies, has 2 voices.

Last updated by Rafael Corts 3 years, 9 months ago.

Assisted by: Jamal.

Author
Posts
#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

Jamal
Supporter

Languages: English (English ) French (Français )

Timezone: Africa/Casablanca (GMT+01:00)

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

Jamal
Supporter

Languages: English (English ) French (Français )

Timezone: Africa/Casablanca (GMT+01:00)

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 hidden link

[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!

This ticket is now closed. If you're a WPML client and need related help, please open a new support ticket.