Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/php/261.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Php 循环表达式引擎条目?_Php_Html_Css_Loops_Expressionengine - Fatal编程技术网

Php 循环表达式引擎条目?

Php 循环表达式引擎条目?,php,html,css,loops,expressionengine,Php,Html,Css,Loops,Expressionengine,我需要一些帮助来循环表达式引擎条目。我一直在做的一个网站撞到了一堵墙。基本上,网站底部有6个最新项目,左右两侧分别有下一个和上一个图标。当您到达项目结束时,会有一个“返回项目开始”按钮,它会将用户带回到项目开始。。。好吧,客户不再需要这个了,只希望条目有一个无限循环 这是否可能与EE,有一个附加的循环条目,我可以使用 我的代码是: {exp:channel:next_entry category_group="1" category="{categories}{category_id}|{/ca

我需要一些帮助来循环表达式引擎条目。我一直在做的一个网站撞到了一堵墙。基本上,网站底部有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}
我可以帮你

用法可能如下所示:

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

表达式引擎不经常出现在这里,因此响应将受到限制。不管你信不信,我过去在这里得到的帮助比在他们论坛上得到的要多。他们的社区不是很有帮助。像EE这样灵活和强大的系统的缺点之一是,一些听起来简单的东西,比如循环条目,实际上是相当棘手的,因为任何条目列表都没有一个顺序或限制。任何结果的顺序和长度都可能变化很大。您好,请尝试一下。它无法工作,因为它需要输入当前的\u条目\u id。真的很无意义,如果它接受{entry_id}就可以了,但是当我尝试这个时,它会抛出一个错误。它也不同时支持category=和category\u group=。我很确定您在案例中使用了current\u entry\u id={entry\u id}或{embed:entry\u id}。而且您永远不需要同时使用category和category\u group,因为category将始终覆盖category\u group。但是不管怎样,再看看这个,这个插件不适合你的特定用途。这意味着在单个条目页面上使用下一个条目和上一个条目链接的意义更大。实际上,它应该。。。我在回答中为您添加了一个代码示例;检查与您的MySQL服务器版本对应的手册,以了解使用第1行的near'和ect.expiration\u date=0或ect.expiration\u date>1314090571和etc.ent'的正确语法sorry,实际上这是错误的错误,这是它抛出的错误:您的SQL语法有错误;检查与MySQL服务器版本对应的手册,以了解第1行的near'和ect.channel\u id=1以及ect.expiration\u date=0或ect.expiration\u date>1'的正确语法