Tell us what you are trying to do?
Hello I'd like to use toolset views inside a toolset form generic field
[cred_field field='form_submit' value='Preview' urlparam='' class='sfc-campaign-new-button']
[cred_generic_field type='radio' field='test' class='test']
{
"required":1,
"default":[],
"options":[{"value":"1","label":"1"},{"value":"2","label":"2"},{"value":"3","label":"3"}]
}
[/cred_generic_field]
the option should come from a views shortcode. How do I have to set up the shortcode?
Is there any documentation that you are following?
https://toolset.com/forums/topic/views-inside-a-cred-generic-field/
Is there a similar example that we can see?
https://toolset.com/forums/topic/views-inside-a-cred-generic-field/
What is the link to your site?
toolkit.kununu.com
Minesh
Supporter
Languages:
English (English )
Timezone:
Asia/Kolkata (GMT+05:30)
Hello. Thank you for contacting the Toolset support.
Well - With last major release of view's we added another display mode "List with separators" which you can use to build your view's output.
More info:
https://toolset.com/documentation/user-guides/view-layouts-101/#list-with-separators
To use view's with the Generic field, it needs JSON format data - so you need to format your view's loop something like:
[wpv-layout-start]
[wpv-items-found]
<!-- wpv-loop-start -->
<wpv-loop>
[wpv-item index=other]
{"value":"[wpv-post-id]","label":"[wpv-post-title]"},
[wpv-item index=last]
{"value":"[wpv-post-id]","label":"[wpv-post-title]"}
</wpv-loop>
<!-- wpv-loop-end -->
[/wpv-items-found]
[wpv-no-items-found]
<strong>[wpml-string context="wpv-views"]No items found[/wpml-string]</strong>
[/wpv-no-items-found]
[wpv-layout-end]
And then use the view as given under:
[cred_generic_field type='radio' field='test' class='test']
{
"required":1,
"default":[],
"options":[[wpv-view name="your-view-slug"]]
}
[/cred_generic_field]
Where:
- Replace 'your-view-slug' with your view's slug
My issue is resolved now. Thank you!