I'm trying to make an anchor to a specific DIV ID or A NAME for each item in the view, but it only shows the first item of the view.
THE IS THE HTML I WANT ON THE PAGE WHERE THE VIEW IS:
<a href="#first">FIRSTITEM</a> - <a href="#second">SECONDITEM</a> - <a href="#third">THIRDITEM</a>
THIS IS MY VIEW:
[wpv-layout-start]
[wpv-items-found]
<!-- wpv-loop-start -->
<wpv-loop>
<a name="[wpv-post-slug]"><h3>[wpv-post-title]</h3></a>
[wpv-view name="gerechten" wpvprchildof="[wpv-post-id id="$menu"]"]
</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]
THIS IS MY CHILDVIEW:
[wpv-layout-start]
[wpv-items-found]
<!-- wpv-loop-start -->
<wpv-loop>
[wpv-post-body view_template="gerechtregel-template"]
</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]
THIS IS MY CHILDVIEW CONTENTTEMPLATE:
<div class="gerecht-item">
<div class="gerecht-item-links">
<h4 class="gerecht-item-title">[types field='naam-gerecht'][/types]</h4>
</div>
<div class="gerecht-item-rechts">
<div class="gerecht-prijs">[types field='prijs-gerecht'][/types]</div>
</div>
<div class="gerecht-item-onder">
[types field='omschrijving-gerecht'][/types]
</div>
[wpv-conditional if="( $(wpcf-biertip) ne '' )"]<div class="gerecht-biertip"><span>Biertip: </span>[types field='biertip'][/types]</div>[/wpv-conditional]
</div>
Shane
Supporter
Languages:
English (English )
Timezone:
America/Jamaica (GMT-05:00)
Hi Patrick,
Thank you for getting in touch.
Since you are doing this in a view loop. Then how you have it here is correct.
[wpv-layout-start]
[wpv-items-found]
<!-- wpv-loop-start -->
<wpv-loop>
<a name="[wpv-post-slug]"><h3>[wpv-post-title]</h3></a>
[wpv-view name="gerechten" wpvprchildof="[wpv-post-id id="$menu"]"]
</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]
This below is also correct.
<a href="#first">FIRSTITEM</a> - <a href="#second">SECONDITEM</a> - <a href="#third">THIRDITEM</a>
However you will need to replace the href values with the slug of the posts. Could you send me a link the page so that I can have a look ?
Thanks,
Shane