Site structure
Version 6.x > Site structure > Folder (only in menu not as page) View modes: 
User avatar
Member
Member
Snarrak - 12/21/2011 5:49:04 AM
   
Folder (only in menu not as page)
Hi there,

I'm wondering if there's a possibility to use de CMS.Folder like this:
- Home (MenuItem)
- Contact (Folder)
- Contact A (MenuItem)
- Contact B (MenuItem)

If I click on a MenuItem it will refresh the whole page and show me content. If I click on a Folder I want the menu to uncollapse, Contact A & B will be visible, but there won't be any content changed (I prefere it without a page refresh).

Is this possible?

Regards,
Jorik

User avatar
Kentico Support
Kentico Support
kentico_janh - 12/22/2011 7:22:48 AM
   
RE:Folder (only in menu not as page)
Hello Jorik,

Of course, you can use the Drop-down menu web part and set its Document types propery for the CMS.MenuItem and also for the CMS.Folder and submenu items appears on the hover or you can use standard CSS List menu or Tree menu web part and mapped a javascript on the mouse click, which un/collapses all subitems.

Best regards,
Jan Hermann

User avatar
Member
Member
Snarrak - 1/3/2012 7:39:51 AM
   
RE:Folder (only in menu not as page)
Hi,

The first thing isn't a problem. The Folder and the MenuItem are displayed in the menu. The behaviour of menuitems is correct, it opens a new page.
But how can I detect a click on a folder? Can I detect the clicked ClassName?

Do you have an example with JavaScript?

Regards,
Jorik

User avatar
Certified Developer 8
Certified Developer 8
Jiveabillion - 1/3/2012 2:40:36 PM
   
RE:Folder (only in menu not as page)
Is there a specific reason you want the menu to expand it's children on click rather than on hover? Unless you had a set in stone requirement to make it behave that way, I would not do it.

Navigation should be intuitive and users are much more accustomed to the dropdown on hover than a click to expand behavior in navigation.

That being said, if you must make it expand on click, I would google for a menu script that does what you are asking and then find a way to get the CMSListMenu to render the markup you need to work with the script you find.

What I have done in the past when I have a page that does not need to have content on it but instead is used to group similar pages is make it so that when that "folder" is clicked, it navigates to the url of it's first child. I believe that you'll find that this practice is very common.

User avatar
Member
Member
Snarrak - 1/5/2012 5:16:30 AM
   
RE:Folder (only in menu not as page)
Hi,

Actually I'm with you on this.
It might be better to uncollapse at hover.
Is there a property of the CMSTreeMenu to uncollapse on hover?

Regards,
Jorik

User avatar
Kentico Support
Kentico Support
kentico_janh - 1/5/2012 5:58:29 AM
   
RE:Folder (only in menu not as page)
Hi,

Yes, there is a OnMouseOver script property in the Tree menu or you can use a Drop-down menu instead, which does it by default.

Best regards,
Jan Hermann

User avatar
Member
Member
Snarrak - 1/5/2012 6:49:51 AM
   
RE:Folder (only in menu not as page)
Ok!
I know I can add a macro to the OnMouseOver script, like OnMouseOverScript="alert('hi')"

But do you know with which macro I can uncollapse al the subitems of the item that is hovered?

Regards,
Jorik

User avatar
Kentico Support
Kentico Support
kentico_janh - 1/6/2012 2:22:25 AM
   
RE:Folder (only in menu not as page)
Hello,

The Tree menu is not a good web part for this kind of functionality, because the menu is not rendered in its entire structure (and the subitems are not hidden by css styles), so I suggest you to use some of the other menus like:

1) Drop-down menu - shows subitems on hover by default
2) Tree view - un/collapses subitems by clicking on a +/- icon
3) CSS list menu - by using javascript and css styles you can achive any effect, because the whole menu structure is rendered

Best regards,
Jan Hermann

User avatar
Member
Member
Snarrak - 1/6/2012 8:39:04 AM
   
RE:Folder (only in menu not as page)
Hi,

I tried the Tree view, this is what I need.
But I'm still wondering, why does the Tree Menu has the property RenderSubItems? Because to me this sounds like the entire-menu is rendered...

Regards,
Jorik

User avatar
Kentico Support
Kentico Support
kentico_janh - 1/7/2012 2:41:20 AM
   
RE:Folder (only in menu not as page)
Hello,

Yes, it sounds like the entire menu structure should be rendered, but as you can see on this link, subitems are rendered only under the current selected document:

Render sub items: Indicates whether the currently selected document should be expanded (if it has sub-items).

Best regards,
Jan Hermann

User avatar
Member
Member
Snarrak - 1/8/2012 4:51:05 AM
   
RE:Folder (only in menu not as page)
Oke thanks.

I changed it to a TreeView, too bad I need to do some new styling... (some tips, good sites?)
But it's what I needed!

User avatar
Kentico Support
Kentico Support
kentico_janh - 1/9/2012 2:26:42 AM
   
RE:Folder (only in menu not as page)
Hello,

The most of styling customization are available directly through the properties of Tree view web part. Here are some important ones:

Hide root node - disappears master page from a menu
Use doc-type images - disables document icons
Item class / Inactive item class / Selected item class - defines classes for menu items, which you can style in your css stylesheet
Collapse image URL / Expand image URL - changes default plus and minus signs to your custom ones

For all available properties of the Tree view web part, please follow the link below to our web part documentation:

http://devnet.kentico.com/docs/webparts/index.html?cmstreeview_properties.htm

Best regards,
Jan Hermann

User avatar
Member
Member
Snarrak - 1/9/2012 3:12:39 AM
   
RE:Folder (only in menu not as page)
These were the most important properties I was looking for, thanks!

Regards,
Jorik