I want to build something like a view - but with the contents taken from multiple repeating fields.
I have some custom types which include for example:
- teaser icons with 4 elements
- teaser headlines also with 4 elements
- teaster content with also 4 elements
Now I would like to create a grid/view that renders 4 blocks, each composed of the same index 0,1,2 or 3 of those different repeating fields:
icon[0] headline[0]
content[0|
icon[1] headline[1]
content[1|
and placed into a grid.
I attached some screenshots of the fields and how the current page online looks like.
Any help is really appreciated,
best regards,
Jan

Minesh
Supporter
Les langues:
Anglais (English )
Fuseau horaire:
Asia/Kolkata (GMT+05:30)
Hello. Thank you for contacting the Toolset support.
Rather creating repeating field in this case - what if you create a repeating field group that will allow you to add the item in single row for all entities.
Please check the following Doc:
- https://toolset.com/course-lesson/creating-and-displaying-repeatable-field-groups/
Is that make sense to use repeating field group in your case?
Hi Minesh,
thanks for your quick reply. Sadly the repeating fields are already created, as they come from a drupal import already - and I want to prevent editing all f them as there are about 1000 of them.
So still any help is really appreciated 🙂
What if you try to use the shortcode [wpv-for-each]:
- https://toolset.com/documentation/programmer-reference/views/views-shortcodes/#wpv-for-each
Add the following shortcode to "Custom Code" section offered by Toolset:
=> https://toolset.com/documentation/programmer-reference/adding-custom-code/using-toolset-to-add-custom-code/
add_shortcode('wpv-index', function ($atts) {
static $i = 0;
if($atts['type']=='get'){
$n = $i;
return $n;
}else if($atts['type']=='set') {
$n = $i++;
}
});
For Example:
<ol>
[wpv-for-each field="wpcf-teaser-icons"]
<li>[types field="teaser-icons"][/types]</li> | [types field="teaser-link" index="[wpv-index type='get']"][/types] | [types field="teaser-content" index="[wpv-index type='get']"][/types] </li>
[wpv-index type='set']
[/wpv-for-each]
</ol>
Where:
- You can modify the field slugs as required.
- Please register the shortcode name wpv-index at:
=> Toolset => Settings => Front-end Content => Third-party shortcode arguments
More info:
- https://toolset.com/documentation/legacy-features/views-plugin/shortcodes-within-shortcodes/#third-party-shortcode-arguments
Can you please try and check if the above solution help you to resolve your issue.