Navigation überspringen

[Gelöst] Shortcode “Allow multiple instances of this field”

Dieser Thread wurde gelöst. Hier ist eine Beschreibung des Problems und der Lösung.

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 vor 4 Jahren, 5 Monaten. 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)

Dieses Thema enthält 3 Antworten, hat 2 Stimmen.

Zuletzt aktualisiert von Rafael Corts vor 4 Jahren, 5 Monaten.

Assistiert von: Jamal.

Author
Artikel
#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 versteckter 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!