Left-sided menu using IF (Smarty)

For questions and problems with the CMS core. This board is NOT for any 3rd party modules, addons, PHP scripts or anything NOT distributed with the CMS made simple package itself.
Post Reply
johnnylocktang
New Member
New Member
Posts: 6
Joined: Wed Jul 03, 2013 7:15 pm

Left-sided menu using IF (Smarty)

Post 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
User avatar
Dr.CSS
Moderator
Moderator
Posts: 12711
Joined: Thu Mar 09, 2006 5:32 am

Re: Left-sided menu using IF (Smarty)

Post 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}
johnnylocktang
New Member
New Member
Posts: 6
Joined: Wed Jul 03, 2013 7:15 pm

Re: Left-sided menu using IF (Smarty)

Post 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
Last edited by johnnylocktang on Wed Jul 03, 2013 7:48 pm, edited 1 time in total.
User avatar
Dr.CSS
Moderator
Moderator
Posts: 12711
Joined: Thu Mar 09, 2006 5:32 am

Re: Left-sided menu using IF (Smarty)

Post 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...
johnnylocktang
New Member
New Member
Posts: 6
Joined: Wed Jul 03, 2013 7:15 pm

Re: Left-sided menu using IF (Smarty)

Post 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.
User avatar
Dr.CSS
Moderator
Moderator
Posts: 12711
Joined: Thu Mar 09, 2006 5:32 am

Re: Left-sided menu using IF (Smarty)

Post 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...
Post Reply

Return to “CMSMS Core”