Page 1 of 1

Code to display children of current section

Posted: Sun Jan 11, 2009 7:41 am
by grimmus
Hi,

I would like to have a left sub menu that only shows the children of the current section. So, for example, if i am browsing the news section, the children of the news node only appear on the left.

Also, if there are no children of the current node i would like to display some news items. How can i check if the child count of the current node is 0 ?

Thanks again

Re: Code to display children of current section

Posted: Mon Jan 12, 2009 3:40 am
by Dr.CSS
I take it you know how to make the menu show children of current page, as for the put news in if no menu items to show thing you need some kind of {if} statement...

{if div !empty=1 show menu}
{else}
{news}
{/if}

Now keep in mind I'm not a programmer just a template builder, but I've seen enuf of this kind of code on this forum to make a guess at the syntax... ;)

Re: Code to display children of current section

Posted: Mon Jan 12, 2009 6:54 am
by JeremyBASS
you can also pipe news in to the menu... then you only need to worrie about the child menu in general...
this has blogs as an ex... but you can switch blogs for news...

http://forum.cmsmadesimple.org/index.ph ... #msg136822

My2Cents
cheers
Jeremy

Re: Code to display children of current section

Posted: Wed Mar 11, 2009 7:36 pm
by szetlan
Having the same problem here: let's say I have three menu sections:

A -> child pages 1, 2, and 3

B -> child pages 4, 5, and 6

C -> child pages 7, 8, and 9


When I'm on page B, 4, 5, or 6 I'd like the submenu to include:

A
B
- 4
- 5
- 6
C

and when on A, 1, 2, or 3 I'd like to see:
A
- 1
- 2
- 3
B
C

Any thoughts?  News/blog doesn't really work in my case, since the pages in question aren't news or blog entries (and since those modules don't do what I need them to, anyway).

This is CMS Made Simple 1.5.3.

Re: Code to display children of current section

Posted: Fri Mar 13, 2009 7:08 am
by ysye
please tell me  how about it?

Re: Code to display children of current section

Posted: Tue Mar 24, 2009 9:33 pm
by Dr.CSS
Any chance you have looked at a default install, just asking as this is the exact menu type that is in most every page of the default install...

Re: Code to display children of current section

Posted: Tue Mar 24, 2009 9:42 pm
by RonnyK
Are you talking about News or about regular Content.

Because with content, you can put the {site_mapper} on the page, to show links to all child_pages, and have it automatically showing new pages, when put in the same "section".

Ronny

Re: Code to display children of current section

Posted: Tue Mar 24, 2009 9:48 pm
by Dr.CSS
Actually RonnyK they just want to have the menu work like it does in the default installs first page, you know click on parent and it shows the children...

Re: Code to display children of current section

Posted: Tue Mar 24, 2009 9:56 pm
by RonnyK
maksbud,

your English is better then mine... I couldn't make that up from the information, I thought they just wanted the links showing on the section-pages.

Ronny