wrong content in pagination links /PX/PY with conditional channel:entries tags, (structure + freebie plugins)
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" p开发者_JAVA百科arse="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
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/
精彩评论