Hi guys,
For this website I'm currently working on I stumbled upon ListItExtended. I love it, it works perfect. However I have 2 small errors I cant seem to fix..
I'm using a custom view to view a list, however $item->field_alias on a category item only shows a number instead of the category name.. I tried the category code from the default, but that shows nothing or gives an error. "Warning: implode() [function.implode]: Invalid arguments passed" etc etc
Second question; My list is quite narrow (in width). I would like to have 3 rows with 10 items, and then have the page end and go to the second page with again 3 rows and 10 items. I understand that I need pagelimit="30", however how do I add the 3 columns?
Thanks in advance!
2 questions regarding ListItExtended
Re: 2 questions regarding ListItExtended
2nd question:
Make the items float left and give them a fixed width that only fits 10 times in the containing block (div)
Example
Of course you need to think about margins, paddings etc.
Other possibility is using a counter for the foreach loop in the template and use the modulo operator. That way you can make rows your self for every ten items. (make sure to close a row when at the last item in case it does not make it to ten items that last row).
Read explanation and example here: http://www.smarty.net/docsv2/en/languag ... erty.index
Make the items float left and give them a fixed width that only fits 10 times in the containing block (div)
Example
Code: Select all
<div id="containing-block" width="800px">
<div class="item" style="float:left;width:80px;height:100px;">item</div>
<div class="item" style="float:left;width:80px;height:100px;">item</div> <div class="item" style="float:left;width:80px;height:100px;">item</div>
[...]
</div> <!-- containing-block -->Other possibility is using a counter for the foreach loop in the template and use the modulo operator. That way you can make rows your self for every ten items. (make sure to close a row when at the last item in case it does not make it to ten items that last row).
Read explanation and example here: http://www.smarty.net/docsv2/en/languag ... erty.index
-
Stikki
Re: 2 questions regarding ListItExtended
Directly from default summary template:
So loader from singular context:
And help for this plugin you can find MOTHER module help section. Instance and actual ListItExtended contains different information.
Code: Select all
{*
Categories were moved to field definitions.
If you need Categories, create new Field definition with alias "category"
and Categories will be available again.
*}
{if $fielddef.type == 'Categories' && ($fielddef.value != '')}
{* use ListIt2Loader plugin if you need Category information in default module action templates *}
{ListIt2Loader item='category' force_array=1 value=$fielddef.value assign='cats'}
<!-- categories -->
<div class="item-category">
Category: {$cats|implode:','}
</div>
<!-- categories //-->
{/if}
Code: Select all
{ListIt2Loader item='category' force_array=1 value=$item->field_alias assign='cats'}

