Categories navigation making page reload (7.2 CE GA2)

thumbnail
Fernando Fernandez, modified 6 Years ago. Expert Posts: 401 Join Date: 8/22/07 Recent Posts
Hi guys,
Using the categories navigation to control  an asset publisher seems to reload the page (even without disabling the SPA). This is normally not a problem but this time I have a long page with a categories navigation controlling an asset publisher near the end of the page. The problem is that, when the user clicks on the category, the browser goes back to the top of the page and the portlets are no longer visible, forcing the user to scroll down again to the bottom of the page.
Is there any way to disable this behaviour? Making asset publisher load by ajax, for example?
TIA

Fernando
thumbnail
Jan van der Kaaden, modified 6 Years ago. Junior Member Posts: 28 Join Date: 3/20/11 Recent Posts
Hola Fernando,

You could use a ADT for the categorynavigation where you add a #[thepartofthepagetogoto] to the link indicating that page with <a name='thepartofthepagetogoto'> </a> (or the HTML5 way) because what the categorynavigation does is simply calling the same page with a categoryid in the url.
This is what your ADT template could look like ...

<#if entries?has_content>
<ul>
<#list entries as curVocabulary>
<li>
${curVocabulary.name}
<ul>
<#list curVocabulary.getCategories() as category>
<li><a href='?p_r_p_categoryId=${category.categoryId}#endofthepage' >${category.name}</a></li>
</#list>
</ul>
</li>
</#list>
</ul>
</#if>
thumbnail
Fernando Fernandez, modified 6 Years ago. Expert Posts: 401 Join Date: 8/22/07 Recent Posts
Hi Jan,
Please correct me if I'm wrong but the problem with that approach, I believe, is that the asset publisher will not render a new list based on that category. 
Fernando