分页链接 /PX/PY 中的内容错误,带有条件通道:条目标签,(结构 + 免费插件)

发布于 2024-11-18 02:21:13 字数 1944 浏览 3 评论 0原文

嘿,表达式工程师,

我正在使用以下代码来测试要渲染哪个 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>

http://www.pastie.org/private/plybrh1adncn7swesuvdw

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>

http://www.pastie.org/private/plybrh1adncn7swesuvdw

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

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

发布评论

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

评论(1

蓬勃野心 2024-11-25 02:21:14

在免费插件开发人员 doug 和 Structure 开发人员 travis 的帮助下,我找到了问题所在。
因为现在似乎有真正的理由这样做,解决问题的一件事是将通道条目标记及其相应的分页嵌入到模板中,并像这样嵌入:

                {if "{freebie_3}" == "categorie"}
                    {embed="medecine_chinoise/articles_template" cat="{freebie_4}" }

                {/if}

                {if "{freebie_4}" == "categorie"}
                    {embed="medecine_chinoise/articles_template" cat="{freebie_5}" }


                {/if}

                {if "{freebie_3}" != "categorie" && "{freebie_4}" != "categorie"}
                    {embed="medecine_chinoise/articles_template" cat="" }

                {/if}

解决方案的两个线程可以在以下位置找到:

<一个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:

                {if "{freebie_3}" == "categorie"}
                    {embed="medecine_chinoise/articles_template" cat="{freebie_4}" }

                {/if}

                {if "{freebie_4}" == "categorie"}
                    {embed="medecine_chinoise/articles_template" cat="{freebie_5}" }


                {/if}

                {if "{freebie_3}" != "categorie" && "{freebie_4}" != "categorie"}
                    {embed="medecine_chinoise/articles_template" cat="" }

                {/if}

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/

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