Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

nested navigation issue


viktordite

Recommended Posts

hi all,

 

i am just trying to modify the /template/infoboxes/categories.html template due to have list Elements instead of tables.

but can't get the "deep search" (dfs) inside the loop:

 

{{foreach from=$BOX.CONTENT item=i}
{if $i.INF_CATEGORY_LEVEL == "1"}
	<li id="mLev-1-{$BOX.INF_BOX_POS}">
		<a href="{$i.LINK_CATEGORY}" class="mLev-1-{$BOX.INF_BOX_POS}">
			{if $i.INF_CATEGORY_SELECTED}
				<strong>{$i.TEXT_CATEGORY_NAME}</strong>
			{else}
				{$i.TEXT_CATEGORY_NAME}
			{/if}
		</a>
	</li>
{elseif $i.INF_CATEGORY_LEVEL == "2"}
	<ul><li id="mLev-2-{$BOX.INF_BOX_POS}">
		<a href="{$i.LINK_CATEGORY}" class="mLev-2-{$BOX.INF_BOX_POS}">
			{if $i.INF_CATEGORY_SELECTED}
				<strong>{$i.TEXT_CATEGORY_NAME}</strong>
			{else}
				{$i.TEXT_CATEGORY_NAME}
			{/if}
		</a>
	</li>
	</ul>
{elseif $i.INF_CATEGORY_LEVEL == "3"}
	<li id="mLev-3-{$BOX.INF_BOX_POS}">
		<a href="{$i.LINK_CATEGORY}" class="mLev-3-{$BOX.INF_BOX_POS}">
			{if $i.INF_CATEGORY_SELECTED}
				<strong>{$i.TEXT_CATEGORY_NAME}</strong>
			{else}
				{$i.TEXT_CATEGORY_NAME}
			{/if}
		</a>
	</li>
{/if}
{/foreach}

 

would like to have nested <ul>s like these:

 

<ul>
 <li>first level</li>
 <li>first level</li>
 <ul>
   <li>second level</li>
   <li>second level</li>
 </ul>
 <ul>
   <ul>
     <li>third level</li>
     <li>third level</li>
   </ul>
 </ul>
 <li>first level</li>
</ul>

 

does anybody have an idea?

Edited by viktordite
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...