Smarty Help

Discussion in 'Programming' started by Boz, Jun 6, 2008.

  1. #1
    Hi there, im fairly new to this forum, i've been browsing some interesting topics... and now... i have a problem of my own. I started as a trainee programmer recently and have been given the task to learn smarty with only basic knowledge of PHP (i'm a noobie). I'm currently working on a progression bar that shows the customer what stage they are at in the ordering progress, and how many stages are ahead.

    The problem that i am having is fairly simple, but as i have next to nothing experience im struggling to complete the final stages. The next step in completing this progression bar is to hide/lock out the steps in the progress bar that dont apply when certain rules are met.

    This is the code so far:

    <div class="progress">
    		{if ($activeMenu.0 == $section) && ($smarty.session.$section.breadcrumbsBar)}
    		{foreach item=item from=$smarty.session.$section.breadcrumbsBar}
    		{if $item.status == 2 &&!$item.lock}
    		<img src="/img/est/progress_bar_join.jpg" style="padding-right:1px; vertical-align:-11px;"><a {if ($activeMenu.1) && ($activeMenu.1 == $key)} class="active" {/if}href="http://{$smarty.server.SERVER_NAME}/{$smarty.const.EST_DIR}/{$section}/{$item}.html"> {$item}</img>
    		{elseif $item.lock}		
    		<img src="/img/est/progress_bar_join.jpg" style="padding-right:1px; vertical-align:-11px;"><a {if ($activeMenu.1) && ($activeMenu.1 == $key)} class="active" {/if}href="http://{$smarty.server.SERVER_NAME}/{$smarty.const.EST_DIR}/{$section}/{$item}.html"> {$item}{if $smarty.session.$section.form.$key.name && !$smarty.session.$section.form.$key.lockBreadCrumb}{/if}</img></a>	
    		{/if}
    		{/foreach}
    		{/if}		
    </div>
    PHP:
    When the section is clicked, all the relevent steps (pulled from breadcrumbs and output using {$item}) pop up on the progress bar, all linked and the next steps are shown. Now i believe the problem lies with:

    {if $item.status == 2 &&!$item.lock}
    {elseif $item.lock}
    {/if}
    PHP:
    After adding this coding, nothing appears to happen... Nothing gets removed, everything is still visible. If anyone is able to help, even in the smallest possible way, it would be much appreciated.

    I have less and less hair everytime i leave work, and have done everything i can considering my knowledge of smarty and php.

    Many thanks

    Boz
     
    Boz, Jun 6, 2008 IP
  2. AVS

    AVS Peon

    Messages:
    100
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    0
    #2
    i am sure some good PHP programmer will help you
     
    AVS, Jun 6, 2008 IP
  3. Boz

    Boz Peon

    Messages:
    3
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #3
    If anyone can help, i'm still looking for advise on this project.

    Everything i have done so far is working, i've got each item being given the right status for locking, now all i need to do is block out the options that aren't needed.
    Is it simplier than i thought?
    Like using an smarty if statement combined with some CSS?

    Boz
     
    Boz, Jun 9, 2008 IP
  4. Boz

    Boz Peon

    Messages:
    3
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #4
    Nevermind, all sorted and project finished! :D
     
    Boz, Jun 12, 2008 IP