Jump to content

weboz

New Members
  • Posts

    3
  • Joined

  • Last visited

    Never

Posts posted by weboz

  1. I haven't worked with .tpl files before, but I know a whole lot of programming languages. Not a single one of them will let you have an elseif without an if before it. If your if is outside of the foreach then this code will never work.

     

    You need to re-think your logic. If you provide a little more of the file and a good explanation of what you are trying to accomplish, I'm sure someone here can point you in the right direction.

     

    Yeah i know, looks like i skipped a line when i copied the code snip.

    As for better information, i do not have any more information, because the system provider for this system will not let me see more of the codes.

    So this is what i have to work with. Going to insert a drop-out menu, and for this i need <ul> to be printet correctly.

    {foreach $categories_array as $category}
    
    {if $category.spacing == '1'}
    
    <li class="cat1 {$class}" style="margin-left:10px;"><a href="{$category.href}">{$category.name}</a></li>
      
                      {elseif $category.spacing == '2'}
                    
    
    
                       <li class="cat2 {$class}" style="margin-left:{0+$category.spacing*10}px;" ><a href="{$category.href}">{$category.name}</a></li>
            
                            {else}
                            <li class="cat0-sub {$class}" style="margin-left:{0+$category.spacing*10}px;" ><a href="{$category.href}">{$category.name}</a></li>
                            {/if}
    {/foreach}  

  2. Hallo, i'm desperate.. I have tried 5 forums without anyone to answer me, so trying this as last tryout :)

     

    Please read the note in the code <!-- -->, need to echo <ul> without looping.

     

    Need help with this code:

    {foreach $categories_array as $category}
    
    <!-- need a code to print <ul class="cat1" without looping-->
    
    <li class="cat1 {$class}" style="margin-left:10px;"><a href="{$category.href}">{$category.name}</a></li>
      
                      {elseif $category.spacing == '2'}
                    
    <!-- need a code to print<ul class="ul-cat2" without looping -->
    
                       <li class="cat2 {$class}" style="margin-left:{0+$category.spacing*10}px;" ><a href="{$category.href}">{$category.name}</a></li>
            
                            {else}
                            <li class="cat0-sub {$class}" style="margin-left:{0+$category.spacing*10}px;" ><a href="{$category.href}">{$category.name}</a></li>
                            {/if}
    {/foreach}

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.