Trying to do something that seems like it should be relatively simple but is not quite working the way that I think it should, so I think I might be missing something.
In my calling template I pass a category (or multiple categories) to the embed which contains the infinite scroll code. So my calling template looks like this:
{embed="topics/ajax_archive" section_cat="50|53|2|1|49|51|52|48|47"}
In the infinite scroll embed I have the following code:
{exp:infinite_scroll:wrapper ajax_container="ajax_container" category="{section_cat}" embed_template_url="{homepage}/topics/ajax_archive" process_indicator="process_indicator" next_chunk_link="next_chunk_link" parse="inward"}
{infinite_scroll_container_top} <div id="ajax_container"> {/infinite_scroll_container_top} {exp:channel:entries channel="article" orderby="date" sort="desc" status="Open|Cover|Top News|Feature Lead|Opinion Lead|Travel Lead|More News" limit="15" paginate="bottom" dynamic="off" parse="inward" disable="categories|category_fields|member_data" category="{embed:section_cat}"} <div class="entry"> <article> <h2><a href="{title_permalink='article/'}">{title}</a></h2> {exp:tagstripper:tagsToSave tags='p|a|b|switch|ul|li'} {exp:eehive_hacksaw chars="250" append="..."} <p>{article_body}</p> {/exp:eehive_hacksaw} {/exp:tagstripper:tagsToSave} <ul class="articledetails"> <li class="author">{embed="includes/authors" entry_id="{entry_id}"}</li> <li class="articlecomments"><span>{entry_date format="%F %d, %Y"}</span></li> </ul> </article> </div> {if count == total_results} <div class="process_indicator"> <p style="padding-top:40px;">Loading...</p> </div> {/if} {paginate}{exp:infinite_scroll:next_chunk_link}{if next_page}<a href="{auto_path}" class="next_chunk_link"><strong><div id="morebutton">More articles »</div></strong></a>{/if}{/exp:infinite_scroll:next_chunk_link}{/paginate} {/exp:channel:entries} {infinite_scroll_container_bottom} </div><!-- End of #ajax_container --> {/infinite_scroll_container_bottom}
{/exp:infinite_scroll:wrapper}
The first set of results come back as planned and are properly narrowed by category, however when I click for more results I lose the category and embed variable (embed:section_cat) from the calling template is no longer passing the values.
Looking at the documentation I see mention of ajax_pagination_vars and ajax_pagination_values and the mention of a complex example. Perhaps I need to leverage these in some way but I don’t see sample code and I’m not clear on the usage based on the documentation.
Anyway I think what I’m doing should be possible perhaps I have a simple mistake or am not understanding how variables are handled in the infinite scroll embed.
Thanks!
Guy
|