I've been looking for some time for and answer to this problem. ordinarily I think pagination would be the answer but I don't want to use the summary mechanism in ListIt2 to render the items but to goto the next item in the list in the detail view.
Is this possible in the same way that CMSMS has a native next /previous page function.
I am using CMSMS 1.12.3
many thanks
ListIt2 link to next and previous items
Re: ListIt2 link to next and previous items
Never used it in ListIt modules, but perhaps worth a try
http://www.cmscanbesimple.org/blog/cmsm ... -scrolling
http://www.cmscanbesimple.org/blog/cmsm ... -scrolling
- + - + - + - + - + - + -
LATEST TUTORIAL AT CMS CAN BE SIMPLE:
Migrating Company Directory module to LISE
Migrating Company Directory module to LISE
- + - + - + - + - + - + -
Re: ListIt2 link to next and previous items
Not really the solution I am looking for, as I want to goto the next item on a new page, I have used scrolling before to stack the list like a carousel but in this case there are lot of assets attached to each listing and need to separate for SEO purposes.
thanks for the suggestion though Rolf.
Mark
thanks for the suggestion though Rolf.
Mark
Re: ListIt2 link to next and previous items
What's your problem using the summary view for this purpose? (beside the fact that it might be less efficient)
(Note you may be able to use the summary in your detail template too)
(Note you may be able to use the summary in your detail template too)
Re: ListIt2 link to next and previous items
not sure how to go about achieving that, nice idea as that would solve the issue of no next/previous links for the details pages. how would i inform the summary template to use another summary template for the details page. any thoughts?
thanks
Mark
thanks
Mark
Re: ListIt2 link to next and previous items
[update Jan 2018] Please read this post too: viewtopic.php?p=336718#p336718
I mean like this:
I added this part at the end of the DETAIL template of LI2.
Note that my LI2 instance is named 'ListIt2test'. Of course you use the name of your instance.
Tested on CMSMS 1.12.1, LI2 1.4.1
Note that
LI2 SUMMARY template 'next_prev':
I mean like this:
I added this part at the end of the DETAIL template of LI2.
Note that my LI2 instance is named 'ListIt2test'. Of course you use the name of your instance.
Tested on CMSMS 1.12.1, LI2 1.4.1
Note that
Code: Select all
{$current_id = $item->item_id}
{*call LI2 summary action with empty summary template.
Just to get $items variable. May NOT work in later versions of CMSMS
Tested on CMSMS 1.12.1 / LI2 1.4.1*}
{ListIt2test summarytemplate=next_prev assign=dummy}
{foreach $items as $sumitem}
{if $sumitem->item_id == $current_id}
{$iteration=$sumitem@iteration}
{if $iteration > 1}{$prev_link = $items[$iteration-1]->url}{/if}
{if $iteration < $sumitem@total}{$next_link = $items[$iteration+1]->url}{/if}
{break}
{/if}
{/foreach}
<div class="next-prev">
{if isset($prev_link)}<a href="{$prev_link}">Previous item</a><br>{/if}
{if isset($next_link)}<a href="{$next_link}">Next item</a><br>}{/if}
</div>
Code: Select all
{*nothing here*}
Re: ListIt2 link to next and previous items
- + - + - + - + - + - + -
LATEST TUTORIAL AT CMS CAN BE SIMPLE:
Migrating Company Directory module to LISE
Migrating Company Directory module to LISE
- + - + - + - + - + - + -
Re: ListIt2 link to next and previous items
I think I should add one note for both my solution and Rolf's (which are mostly doing the same):
IF you call the INITIAL summary action with some kind of 'filtering' (e.g. category=x) then it would be important to use that same 'filter' when calling the summary action for the prev/next links.
However, I doubt (don't know for sure) that those initial 'filters' are available in the detail action. If they indeed are NOT available in the detail action (template) then you should think of some smart things to work around that, or just hard code them in the detail template.
IF you call the INITIAL summary action with some kind of 'filtering' (e.g. category=x) then it would be important to use that same 'filter' when calling the summary action for the prev/next links.
However, I doubt (don't know for sure) that those initial 'filters' are available in the detail action. If they indeed are NOT available in the detail action (template) then you should think of some smart things to work around that, or just hard code them in the detail template.