|
Smarty
WARNING: All discussion is moving to https://reddit.com/r/smarty, please go there! This forum will be closing soon. |
|
View previous topic :: View next topic |
Author |
Message |
pHaeno* Smarty Rookie
Joined: 14 Oct 2008 Posts: 18
|
Posted: Mon Mar 10, 2014 9:53 pm Post subject: implementing .jCarouselLite() |
|
|
Okay. Hello again.
Im trying to implement jCarouselLite into my current homepage.
Everything is working fine.
Im using <ul><li></li></ul> tags to get it working. but know i have some trouble.
The first count and every 20 count i have to change the <li> tags.
It must be like this:
<ul>
<li class="1">... 20 entries in</li>
<li class="2">...another 20 entries</li>
<li class="3">... and so on</li>
</ul>
im getting the datas from a databse query to read the logfiles from my homepage and stuff.
can somebody give my solution to get this working?
Hope there is someone who can help me. |
|
Back to top |
|
pHaeno* Smarty Rookie
Joined: 14 Oct 2008 Posts: 18
|
Posted: Tue Mar 11, 2014 2:05 am Post subject: |
|
|
okay. maybe someone has a better way todo this.
But for now im dealing with this:
Code: | <ul>{foreach from=$LOOP_DATA item=DATA name=DATA_LIST}{if $DATA@first}
<li>{elseif ($DATA@iteration - 1) is div by 20}
</li>
<li>{/if}
<p>{$DATA.id}</p>{if $DATA@last}
</li>{/if}
{/foreach}
</ul> |
So i got the first <li> tag at the start and evry 20 count of the value i got the </li><li> tag. And its working fine. |
|
Back to top |
|
mohrt Administrator
Joined: 16 Apr 2003 Posts: 7368 Location: Lincoln Nebraska, USA
|
Posted: Tue Mar 11, 2014 3:29 pm Post subject: |
|
|
It can be a little cleaner:
Code: | <ul>
<li>
{foreach from=$LOOP_DATA item=DATA name=DATA_LIST}
{if $DATA@index is div by 20}</li><li>{/if}
<p>{$DATA.id}</p>
{/foreach}
</li>
</ul> |
|
|
Back to top |
|
pHaeno* Smarty Rookie
Joined: 14 Oct 2008 Posts: 18
|
Posted: Wed Mar 12, 2014 11:23 pm Post subject: |
|
|
Thanks for the reply. |
|
Back to top |
|
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|