Hi there,
I'm using the Listit2 module and was wondering if there was a way to display 3 x random sibling items?
When I say sibling items, I have various categories which my items are in. At the bottom of the detail page I'd like to display 3 random items from within the same category as the current detail page item. Does this make sense and is this possible?
Thanks in advance
Listit2 - Can detail template display sibling items?
Re: Listit2 - Can detail template display sibling items?
I think it would - I don't have the cms in front of me atm - but the detail template should be able to tell you which cateogry that item is in.
You then call a summary template using Listit2 as normal specifiying this category, this template should utilize something like this: http://www.i-do-this.com/snippets/Show- ... -arrays/56
Which will randomise the items, then all you have to do is loop through the newly created array, with a limit of 3 for loop
You then call a summary template using Listit2 as normal specifiying this category, this template should utilize something like this: http://www.i-do-this.com/snippets/Show- ... -arrays/56
Which will randomise the items, then all you have to do is loop through the newly created array, with a limit of 3 for loop

Re: Listit2 - Can detail template display sibling items?
Hi, thank you very much for your reply.
I will have a play and see what I come up with. Thank you for your help!
I will have a play and see what I come up with. Thank you for your help!
Re: Listit2 - Can detail template display sibling items?
Howdy,
If you navigated into item from category URL, then variable: $category is assigned by default. This applies to all frontend actions.
This means you can call something like this inside your detail template:
{ListIt2Instance category=$category->category_alias pagelimit=3 orderby='rand'}
This way everything is DB driven and you wont cause extra load time with Smarty.
If you didn't navigate into item using category links, then current category object ain't available and you have to use {ListIt2Loader} to load category data into variable and then use that data.
This works with ListItExtended 1.4.1 +
If you navigated into item from category URL, then variable: $category is assigned by default. This applies to all frontend actions.
This means you can call something like this inside your detail template:
{ListIt2Instance category=$category->category_alias pagelimit=3 orderby='rand'}
This way everything is DB driven and you wont cause extra load time with Smarty.
If you didn't navigate into item using category links, then current category object ain't available and you have to use {ListIt2Loader} to load category data into variable and then use that data.
This works with ListItExtended 1.4.1 +
Re: Listit2 - Can detail template display sibling items?
Way more elegant, I've never done this with listit before so didn't realise it was baked in!