开发者

Loop Expression Engine Entries?

开发者 https://www.devze.com 2023-03-29 23:32 出处:网络
I need some assistance with looping expression engine entries. I\'ve hit a brick wall with a website i\'ve been wo开发者_JAVA技巧rking on. Basically the site has 6 latest projects at the bottom with n

I need some assistance with looping expression engine entries. I've hit a brick wall with a website i've been wo开发者_JAVA技巧rking on. Basically the site has 6 latest projects at the bottom with next and prev icons to the left and right. When you reach the end of the projects there is a back to start of projects button that brings the user back to the start of the projects... well, the client doesn't want this anymore and just wants the entries have an infinite loop!

Is this possible with EE, is there an add-on for looping entries I could use?

My code is:

{exp:channel:next_entry category_group="1" category="{categories}{category_id}|{/categories}"}
<a class="rightNav" href="{id_path='projects-test/view'}" style="color:#000;"><<</a>
{/exp:channel:next_entry}

{embed="projects-test/related" stop_before="{entry_date format="%Y-%m-%d %H:%i"}" category_id="{categories show_group="1" limit="1"}{category_id}{/categories}"}

{exp:channel:prev_entry category_group="1" category="{categories}{category_id}|{/categories}"}
<a class="leftNav" href="{id_path='projects-test/view'}" style="color:#000;">>></a>
{/exp:channel:prev_entry}

{/exp:channel:entries}

Related template code:

{exp:channel:entries channel="project" limit="6" category_group="1" stop_before="{embed:stop_before}" related_categories_mode="yes" custom_fields="yes"}
{if count == "1"}<ul id="filmStrip">{/if}
<li>
{exp:imgsizer:size src="{project_image}" height="68px" width="137px"}
<a href="{title_permalink='projects-test/view'}"><img src="{sized}" height="{height}" width="{width}" alt=""/></a>
{/exp:imgsizer:size}
<a href="{title_permalink='projects-test/view'}"><p class="thumbTitle">{title}</p></a>
</li>
{if count == total_results}</ul>{/if}
{/exp:channel:entries}


This plugin may do the trick for you.

Usage probably looks like this:

{exp:bbr_prevnext_entry current_entry_id="{entry_id}" category="{categories}{category_id}|{/categories}" channel_name="project" orderby="entry_date" sort="desc" return_fields="entry_id" cycle="yes"}   
    <a class="rightNav" href="/projects-test/view/{next_entry_id}" style="color:#000;"><<</a>
{/exp:bbr_prevnext_entry}

{embed="projects-test/related" stop_before="{entry_date format="%Y-%m-%d %H:%i"}" category_id="{categories show_group="1" limit="1"}{category_id}{/categories}"}

{exp:bbr_prevnext_entry current_entry_id="{entry_id}" category="{categories}{category_id}|{/categories}" channel_name="project" orderby="entry_date" sort="desc" return_fields="entry_id" cycle="yes"}   
    <a class="leftNav" href="/projects-test/view/{prev_entry_id}" style="color:#000;">>></a>
{/exp:bbr_prevnext_entry}
0

精彩评论

暂无评论...
验证码 换一张
取 消