Hi
I have a slider in the homepage of the site ( Flexslider in a view)
RIght now, the image is called from the featured image of à 'project'
I need to change the featured image for the first image a 'Repeatable group''
Can you please tell me how to call just the first image of the group ?
+Project 1
++Image 1
++Image 2
++Image 3
+Project 2
++Image 1
++Image 2
++Image 3
+Project 3
++Image 1
++Image 2
++Image 3
My slider should show the image 1 of every project..
Thanks
Miguel
Hi, here's the documentation for creating a View of a repeating field group:
https://toolset.com/documentation/getting-started-with-toolset/creating-and-displaying-repeatable-field-groups/#displaying-repeatable-field-groups
To show only the first image in each group, you should set the "Limit" of this View to be 1 (see the screenshot). If you cannot see the "Limit and Offset" section in the View editor screen, scroll to the top right corner and click "Screen Options". You can turn on the "Limit and Offset" section here.
Hi Christian
A couple more quetions
If I create à view for the first image, when I insert that view into another view I get a DIV (with à bunch of code); How can I get a CLEAN URL ?
The loop from the 'first image' view should be something like this ?
<wpv-loop>
[types field='photo' size='slide-projet' item='@projet-photo.parent' url='true'][/types]
</wpv-loop>
_________________________
The code for the homepage slider is
<li data-thumb='[VIEW WITH CLEAN URL]' class='thumb' data-thumb-alt='[wpv-post-title] - Mutabilis'>
<img src='[VIEW WITH CLEAN URL]' alt='[wpv-post-title] - Mutabilis' tittle=' [wpv-post-title item="$current_page"] - Mutabilis' />
[wpv-post-title]
[types field='lieu'][/types] ( [types field='departement' output='raw'][/types] )
_________________________
Thanks a lot for your help
We are working on a new feature that will produce View results with no extra markup (a raw View), but it's not quite ready yet. In the meantime, you can add this custom filter in your child theme's functions.php to strip all the extra markup from a View:
add_filter( 'wpv_filter_wpv_view_shortcode_output', 'prefix_clean_view_output', 5, 2 );
function prefix_clean_view_output( $out, $id ) {
$ids = array( 12345 );
if ( in_array( $id, $ids )) {
$start = strpos( $out, '<!-- wpv-loop-start -->' );
if (
$start !== false
&& strrpos( $out, '<!-- wpv-loop-end -->', $start ) !== false
) {
$start = $start + strlen( '<!-- wpv-loop-start -->' );
$out = substr( $out , $start );
$end = strrpos( $out, '<!-- wpv-loop-end -->' );
$out = substr( $out, 0, $end );
} else {
$start = strpos( $out, '>' );
if ( $start !== false) {
$out = substr( $out, $start + 1 );
$end = strpos( $out, '<' );
$out = trim(substr( $out, 0, $end ));
}
}
}
return $out;
}
Change 12345 to match the numeric ID of the View you want to produce raw code. Then remove any extra spaces and line breaks from the View's Loop Editor and any Content Template used in the View.