Here is the Sample Code:
{section name="firstlevel" loop=$xxx}
<ul>
{section name="secondlevel" loop=$xxx[firstlevel]}
<li>$xxx[firstlevel][secondlevel].values</li>
{/section}
</ul>
{sectionelse}
No values
{/section}
{if $smarty.section.firstlevel.last}
{include file="pagination.tpl"}
{/if}
I have limited 10 records per page, but this smarty code not calling the include file pagination. Please suggest what wrong in it or give idea...
views:
430answers:
1
A:
I'm not a Smarty guru but I believe "last" only returns true while in the section. This would probably be preferable anyway as there is little or no use showing pagination when there are no records.
{section name=firstlevel loop=$xxx}
<ul>
{section name=secondlevel loop=$xxx[firstlevel]}
<li>$xxx[firstlevel][secondlevel].values</li>
{/section}
</ul>
{if $smarty.section.firstlevel.last}
{include file="pagination.tpl"}
{/if}
{sectionelse}
No values
{/section}
enbuyukfener
2010-01-11 10:50:29
Thanks, but its not working ....
boss
2010-01-11 10:58:34
Can you explain what it is that is not working? I decided to try it out and it is working for me. Try add some text in the `{if $smarty.section.firstlevel.last}` section to ensure that conditional is working, and then ensure pagination.tpl outputs something.
enbuyukfener
2010-01-11 22:33:13
U can see in the section {section name=firstlevel loop=$xxx}
boss
2010-01-12 04:51:37
You can see the pagination at the end of the section? If so, isn't that what you want?
enbuyukfener
2010-01-12 05:19:15