分页链接 /PX/PY 中的内容错误,带有条件通道:条目标签,(结构 + 免费插件)
嘿,表达式工程师,
我正在使用以下代码来测试要渲染哪个 cannel:entries 标记,具体取决于某些免费变量的值(请参阅下面的代码片段)。
问题:虽然它只呈现一组链接(这是正确的),但分页链接内容似乎会受到模板中 {paginate} 标签数量的影响,例如当满足最后一个条件时。我的分页链接格式为 ..../PX/PX/PY/.... 而不是 /PX
<div id="content">
{exp:channel:entries channel="medecine_chinoise"}
<h1>{title}</h1>
{/exp:channel:entries}
{if "{freebie_3}" == "categorie"}
{exp:channel:entries channel="medecine_chinoise_articles" category="{freebie_4}" dynamic="no" limit="6" paginate="bottom" parse="inward"}
...
{paginate}
{if "{total_pages}" != 1} <hr />
{pagination_links}
{/if}
{/paginate}
{/exp:channel:entries}
{/if}
{if "{freebie_4}" == "categorie"}
{exp:channel:entries channel="medecine_chinoise_articles" category="{freebie_5}" dynamic="no" limit="6" paginate="bottom" parse="inward"}
...
{paginate}
{if "{total_pages}" != 1} <hr />
{pagination_links}
{/if}
{/paginate}
{/exp:channel:entries}
{/if}
{if "{freebie_3}" != "categorie" && "{freebie_4}" != "categorie"}
{exp:channel:entries channel="medecine_chinoise_articles" dynamic="no" limit="6" paginate="bottom" parse="inward"}
...
{paginate}
{if "{total_pages}" != 1} <hr />
{pagination_links}
{/if}
{/paginate}
{/exp:channel:entries}
{/if}
</div>
hey expressionengineers,
i am using the following code to test which cannel:entries tag to render depending on the value of cerstain freebie variables (see code snippet below).
the problem: although it renders only one set of links (which is correct) the pagination links content seems to be affected due to the number of {paginate} tags in the template as when for example the last condition is hit. i have pagination links in the format ..../PX/PX/PY/.... and not /PX
<div id="content">
{exp:channel:entries channel="medecine_chinoise"}
<h1>{title}</h1>
{/exp:channel:entries}
{if "{freebie_3}" == "categorie"}
{exp:channel:entries channel="medecine_chinoise_articles" category="{freebie_4}" dynamic="no" limit="6" paginate="bottom" parse="inward"}
...
{paginate}
{if "{total_pages}" != 1} <hr />
{pagination_links}
{/if}
{/paginate}
{/exp:channel:entries}
{/if}
{if "{freebie_4}" == "categorie"}
{exp:channel:entries channel="medecine_chinoise_articles" category="{freebie_5}" dynamic="no" limit="6" paginate="bottom" parse="inward"}
...
{paginate}
{if "{total_pages}" != 1} <hr />
{pagination_links}
{/if}
{/paginate}
{/exp:channel:entries}
{/if}
{if "{freebie_3}" != "categorie" && "{freebie_4}" != "categorie"}
{exp:channel:entries channel="medecine_chinoise_articles" dynamic="no" limit="6" paginate="bottom" parse="inward"}
...
{paginate}
{if "{total_pages}" != 1} <hr />
{pagination_links}
{/if}
{/paginate}
{/exp:channel:entries}
{/if}
</div>
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
在免费插件开发人员 doug 和 Structure 开发人员 travis 的帮助下,我找到了问题所在。
因为现在似乎有真正的理由这样做,解决问题的一件事是将通道条目标记及其相应的分页嵌入到模板中,并像这样嵌入:
解决方案的两个线程可以在以下位置找到:
<一个href="https://struct.tenderapp.com/discussions/problems/1209-paginate-pagination-not-working-properly-builds-urls-like-pxp2x-where-x-is-the-limit-parameter-number ” rel =“nofollow”>https://struct.tenderapp.com/discussions/problems/1209-paginate-pagination-not-working-properly-builds-urls-like-pxp2x-where-x-is-the-limit-参数编号
http://devot-ee.com/add-ons/support/freebie/viewthread/2028/
i was able to track down the problem with the help of the freebie plugin developer doug and structure`s developer travis.
as there seems to be now real reason why to do so the one thing which solved the issue was embedding the channel entries tag and its corresponding pagination inside a template and embed it like this:
the two thread to the solutions can be found at:
https://structure.tenderapp.com/discussions/problems/1209-paginate-pagination-not-working-properly-builds-urls-like-pxp2x-where-x-is-the-limit-parameter-number
http://devot-ee.com/add-ons/support/freebie/viewthread/2028/