Show news when no submenu items are listed

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
hypnootik
Forum Members
Forum Members
Posts: 16
Joined: Tue Oct 09, 2007 12:26 pm

Show news when no submenu items are listed

Post by hypnootik »

Hi

I have just installed my first CMSMS. Nice program :).
But I cant find the way to customize it to suit my needs.
I would like to display {news} when no submenu links are present.

I have menu placed in my template as fallows:

Code: Select all

 in top of the page - header : {menu template='simple_top_navigation.tpl' number_of_levels='1' collapse='1'}

Roght side of the page - {menu template='simple_navigation.tpl' start_level='2' collapse='0'}
I tried to set it in simple_navigation.tpl but when no menu items are listed from start_level=2 the CMS does not include the menu template at all.

So what do I have to change to get this thing working?  :)


Best regards and sorry for my poor english,

hypnootik
hypnootik
Forum Members
Forum Members
Posts: 16
Joined: Tue Oct 09, 2007 12:26 pm

Re: Show news when no submenu items are listed

Post by hypnootik »

Hi

Really could need some help here    ???


Thanks
User avatar
Dr.CSS
Moderator
Moderator
Posts: 12711
Joined: Thu Mar 09, 2006 5:32 am

Re: Show news when no submenu items are listed

Post by Dr.CSS »

Sounds like you need an {if} statement in your template, you could just put the {news} under where you put the menu tag that way it will be there one way or the other...
hypnootik
Forum Members
Forum Members
Posts: 16
Joined: Tue Oct 09, 2007 12:26 pm

Re: Show news when no submenu items are listed

Post by hypnootik »

Thanks for Your reply.


I tried putting the {news} tag inside {if} statement in main template but could't find the right term to use for {if}.


:)
hypnootik
Forum Members
Forum Members
Posts: 16
Joined: Tue Oct 09, 2007 12:26 pm

Re: Show news when no submenu items are listed

Post by hypnootik »

Hi again!

I have searched the forum for 4 hours and still stuck in the same thing.
Should I have something like this in my main template?

"MAIN TEMPLATE.tpl"

Code: Select all

<div id=Top_links>
            {menu template='simple_top_menu' number_of_levels='1' collapse='1'}
</div>

<div id=rightbar>

{if ??? checking if there are any menuitems in level 2 ???? }
            {menu template='proovikas' start_level='2' collapse='0'}
{else}
            {news}
{/if}
</div>
What should be the parameter inside  IF statement???
If there is no items starting from second level the menutemplate will not be loaded at all.


Appreciate any help.

Thanks
hypnootik
Forum Members
Forum Members
Posts: 16
Joined: Tue Oct 09, 2007 12:26 pm

Re: Show news when no submenu items are listed

Post by hypnootik »

Isn't there any solution for this ?


???
User avatar
Dr.CSS
Moderator
Moderator
Posts: 12711
Joined: Thu Mar 09, 2006 5:32 am

Re: Show news when no submenu items are listed

Post by Dr.CSS »

I don't know how to write {if} statements and a search of the forum for {if} shows an error?...
Post Reply

Return to “CMSMS Core”