Smarty Forum Index Smarty
WARNING: All discussion is moving to https://reddit.com/r/smarty, please go there! This forum will be closing soon.

implementing .jCarouselLite()

 
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    Smarty Forum Index -> General
View previous topic :: View next topic  
Author Message
pHaeno*
Smarty Rookie


Joined: 14 Oct 2008
Posts: 18

PostPosted: Mon Mar 10, 2014 9:53 pm    Post subject: implementing .jCarouselLite() Reply with quote

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
View user's profile Send private message
pHaeno*
Smarty Rookie


Joined: 14 Oct 2008
Posts: 18

PostPosted: Tue Mar 11, 2014 2:05 am    Post subject: Reply with quote

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
View user's profile Send private message
mohrt
Administrator


Joined: 16 Apr 2003
Posts: 7368
Location: Lincoln Nebraska, USA

PostPosted: Tue Mar 11, 2014 3:29 pm    Post subject: Reply with quote

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
View user's profile Send private message Visit poster's website
pHaeno*
Smarty Rookie


Joined: 14 Oct 2008
Posts: 18

PostPosted: Wed Mar 12, 2014 11:23 pm    Post subject: Reply with quote

Thanks for the reply. Smile
Back to top
View user's profile Send private message
Display posts from previous:   
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    Smarty Forum Index -> General All times are GMT
Page 1 of 1

 
Jump to:  
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
Protected by Anti-Spam ACP