how do i use if loop in smarty template file?

Posted on 2009-04-27
Last Modified: 2012-05-06
want to display different div based n iteration, below code is not working. its just load first div,
want to load first div when the first iteration and 3,6,9,12, etc.. tanks.
{if count($doc_list) gt 4}

								<div class="insidediv">


								{section name=i loop=$doc_list start=4}


										{if ($k==0) or ($k%3==0)}

											<div class="addbox1">		


											<div class="addbox">




										Data will be displayed here






Open in new window

Question by:penuel
    1 Comment
    LVL 3

    Accepted Solution


    {if ($k==0) or ($k%3==0)}
                                                                                            <div class="addbox1">          
                                                                                            <div class="addbox">


    {php} if (($k==0) or ($k%3==0)){{/php}
                                                                                            <div class="addbox1">          
                                                                                            <div class="addbox">

    Featured Post

    What Security Threats Are You Missing?

    Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

    Join & Write a Comment

    The first time you look at a web page and its source code, you are probably a little intimidated by the use of symbols and jargon that really looks foreign to you. You might not even know where to start to begin learning what it all means. That’…
    Building “do-it-yourself” web sites has become an epidemic. There are so many blogs, web sites and even books that "teach" you how to build your web site in a few extremely simple and easy steps. Building a web site has become easier than boiling an…
    The viewer will learn how to count occurrences of each item in an array.
    This tutorial will teach you the core code needed to finalize the addition of a watermark to your image. The viewer will use a small PHP class to learn and create a watermark.

    746 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    15 Experts available now in Live!

    Get 1:1 Help Now