Hi to all.
I am new on this list.
I got the following problem
I have an array:

$options = array(array('t_products','t_users','t_orders','t_settings'),
                 array('products.png','user.png','orders.png','settings.png'),
             
array(array(array('index-multi2.php','index-multi3.php','index-multi4.php'),
                               array('t_manage1','t_linked','t_status')),
                      
array(array('index-multi.php','index-multi.php','index-multi.php','index-multi.php'),
                              array('t_manage','Content 2 1 2','Content 2 1 
3','Content 2 2 1')),
                      
array(array('index-multi2.php','index-multi3.php','index-multi4.php'),
                                array('t_manage1','t_linked','t_status')),
                     
array(array('index-multi2.php','index-multi3.php','index-multi4.php'),
                            array('t_manage1','t_linked','t_status')),

and I want to generate such a menu:

<li>
     <a href="javascript:;"><img src="../gfx/icons/products.png" 
/><div>t_products</div></a>
     <div>
     <ul>
           <li><a href="index-multi.php">t_manage</a></li>
           <li><a href="index-multi.php">t_linked</a></li>
           <li><a href="index-multi.php">t_status</a></li>
     </ul>
     </div>
</li>
<li>
     <a href="javascript:;"><img src="../gfx/icons/user.png" 
/><div>t_users</div></a>
     <ul>
           <li><a href="index-multi.php">t_manage</a></li>
           <li><a href="index-multi.php">Content 2 1 2</a></li>
           <li><a href="index-multi.php">Content 2 1 3</a></li>
                    ............
      </ul>
  </li>
<li>
..........

etc..

My script in SMARTY looks like this and works fine:

<div id="left_panel">
   <ul id="menu" class="ui-accordion-container">
      {foreach from=$options[0] key="key" item="entry"}
       <li>
            <a href="javascript:;"><img 
src="../gfx/icons/{$options[1][$key]}" /><div>{$options[0][$key]}</div></a>
            <div>
                <ul>
                    {foreach from=$options[2][$key][0] key="key2" 
item="entry2"}
                      <li><a 
href="{$entry2}">{$options[2][$key][1][$key2]}</a></li>
                    {/foreach}
                </ul>
            </div>
       </li>
      {/foreach}
  </ul>
</div>

My PHPTAL script (not complited):

   <div id="left_panel">
       <ul id="menu" class="ui-accordion-container">
           <li tal:repeat="option options/0">
                <a href="javascript:;"><img 
src="../gfx/icons/${options/1/key}/" /><div>${option}</div></a>
                <div>
                <ul>
                    <!-- inner loop -->
                </ul>
            </div>
           </li>
      </ul>
</div>


How to access second row in array ( array('products.png','user.png',...) ) 
inside <li tal:repeat="option options/0"> to set proper path in <img 
src=".....">??

Greetings
Majkel
_______________________________________________
PHPTAL mailing list
PHPTAL@lists.motion-twin.com
http://lists.motion-twin.com/mailman/listinfo/phptal

Reply via email to