循环表达式引擎条目?

发布于 2024-11-30 18:39:05 字数 1528 浏览 1 评论 0原文

我需要一些有关循环表达式引擎条目的帮助。我一直在开发的网站遇到了障碍。基本上,该网站底部有 6 个最新项目,左侧​​和右侧有下一个和上一个图标。当您到达项目结束时,有一个返回到项目开始按钮,可以将用户带回到项目的开始...好吧,客户不再需要这个,只希望条目有一个无限循环!

这对于 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}

I need some assistance with looping expression engine entries. I've hit a brick wall with a website i've been working 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}

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

澜川若宁 2024-12-07 18:39:05

这个插件可能适合你。

用法大概是这样的:

{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}

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}
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文