我需要一些循环表达引擎条目的帮助。我用一个我一直在努力的网站打砖墙。基本上,该网站底部有6个最新项目,左侧和右侧有next和prev图标。当你到达项目的末尾时,有一个回到项目开始的按钮,它将用户带回到项目的开始......好吧,客户端不再需要这个了,只是希望条目具有无限循环!
这是否可以使用EE,是否有可用于循环条目的附加组件?
我的代码是:
{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}
相关模板代码:
{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}
答案 0 :(得分:0)
This plugin可能会为你做到这一点。
用法可能如下所示:
{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}