Page 1 of 1

Left-sided menu using IF (Smarty)

Posted: Wed Jul 03, 2013 7:20 pm
by johnnylocktang
Hi,

Quick question. I've been using this If-statement for awhile now, but since I added Multi Lingual support its not really working anymore.

The main difference might be that i reverted the order of pages.
  • 1. Swedish
    1.1 Home
    2.2 About
Etc, and I have 3 of "those". Swedish, English and Deutsch

Code: Select all

<!-- start #navigate menu to the left -->
{if $cgsimple->has_children() || $cgsimple->get_parent_alias()} 
<li>
  <h2>Navigera</h2>				
  {menu template='zionnarrows : minimal_menu'  start_level='2' collapse='1' number_of_levels='3'} 				
</li>{else} {/if}
<li>
<!-- end #navigate menu to the left -->

Thanks in advance,
John

Re: Left-sided menu using IF (Smarty)

Posted: Wed Jul 03, 2013 7:32 pm
by Dr.CSS
Most times if you want to not show something if it is empty you would use assign...

{menu template='zionnarrows : minimal_menu' start_level='2' collapse='1' number_of_levels='3' assign='test'}
{if !empty($test)} // this means if not empty
<div>
{$test}
</div>
{/if}

Re: Left-sided menu using IF (Smarty)

Posted: Wed Jul 03, 2013 7:37 pm
by johnnylocktang
Thanks for the quick reply.

Problem is, I get the menu to dissapear but before i reverted my pages the "Navigera" part was also gone.

So, for example, when we are on the "Home" page. This page does not contain any childs or anything. And if we browse to another page, for example "Pictures", this page got a couple of under pages / childs.

As you can see here. How could I adapt to this? Before I reverted the pages (Svenska, English, Deutsch) everything worked fine.
Image

Re: Left-sided menu using IF (Smarty)

Posted: Wed Jul 03, 2013 7:48 pm
by Dr.CSS
Anything you want to be there all the time goes on the outside of that call, otherwise I'm not sure what you mean...

Re: Left-sided menu using IF (Smarty)

Posted: Wed Jul 03, 2013 7:52 pm
by johnnylocktang
This is what It looks like when im at "Hem", right under the Internal Page Link "Svenska".

Image
All of this should be gone regarding the IF-statement.

Re: Left-sided menu using IF (Smarty)

Posted: Thu Jul 04, 2013 6:02 pm
by Dr.CSS
Looks like you need to use start_level='3' as 'Hem' is second level so of course it's going to show there with it's siblings...