Menu question

Posted by Community Admin on 03-Aug-2018 06:51

Menu question

All Replies

Posted by Community Admin on 05-Sep-2012 00:00
I have about 75 pages in the project, but only really two looks. First page and everything else.
So naturally i created two page templates and stuck all the navigation in there, so that all pages have it ready.
I put a top nav bar at the top with some 5 items, and a side one that has all the sub-menus.

This is where i can't quite get it to work the way i want. I would like the side menu to never show the top items since they are already in the top area. In other words if the user is anywhere within the home section, i want the side menu to show everything that is under Home.

There appear to be 3 choices only either show everything, including the top level, show everything under the currently selected item. Or show everything under a specific page.

Naturally i could simply put the navigation in each page and make it show everything from a selected page, or make 6 templates and assign the pages to one of the templates.

But if i then move the page from one section to another i will need to edit the menu or assign a different template to it. I would rather have this work more dynamically. 

Is there a way i can keep just one template and somehow set the menu to show all in the currently selected section apart of the top item?
Posted by Community Admin on 05-Sep-2012 00:00

Dear Andrew I use RadControls for this.

Here is what I have.

Tamplate Home with main navigation
Tamplate Normal with subnavi in it

I use RadControls for Subnavi (you need to acitve them in Admin - Advanced -  Toolboxes - Radcontrols if I remember correct)

Then under Daten Drag the Sitemap Datasource to your page (sorry SBE German no way to know what's it in english) sf_subnavi_01.png

ShowStartingNode = False
SiteMapProvider = SitefinitySiteMap
StartFromCurrentNode = False
StartingNodeOffeste = 1


Copy the ID to clipboard Ctrl + C

Then drag the RadControl (I use Panelbars a lot) to the template page

DataSourceID set to the one from sitemap datasource Ctrl + V should do the trick.

Remember for styling you need to turn off embeded skins and stuff.

------

Old fashion, not out of the box, but works every time and I can set my own styles which is less then using embed.

Markus
Posted by Community Admin on 05-Sep-2012 00:00
Sounds like a good plan.
However i cannot find how to activate those RadControls.

I can go to Admin - Settings - Advanced - Toolboxes. but there i can only delete or add new items.
Don't see a way to activate anything.

-UPDATE-
Found it now. Just enabled them and will try your solution.
Posted by Community Admin on 05-Sep-2012 00:00
Dear Andrew

Glad you found it. For others who did not find it right away see screenshot.

Markus


Posted by Community Admin on 05-Sep-2012 00:00
That worked like a dream.
Thanks Markus, du bist ein Genie
Posted by Community Admin on 05-Sep-2012 00:00
Dear Andrew

Thank's for the flower but an a Genie level from 0 - 100 I am at 10. 

I wanted, PanelBar, Menu with flyout to right and stuff in my secondary navigation. Back some time SF would not provide these options so I had to choose this path. Don't know if 5.1 has panelbar and flyout menu now to be used as secondary navigtion with first item ignoring.

This works for me at the moment.

Glad I could help. Usually I am the one getting help :-)

Markus
Posted by Community Admin on 05-Sep-2012 00:00
I have one more question.
Do you know if i can disable the collapse functionality?
I want to have all the item extended. All open in essence.
Is that possible with the panel?
I have been looking at the Telerik demos but can't see an example there.
Posted by Community Admin on 05-Sep-2012 00:00
Dear Andrew

PanelBar has 3 Expand Modes
http://mono.telerik.com/PanelBar/Examples/Functionality/PanelbarBehavior/DefaultCS.aspx 

There is no such thing out of the box as far as I know
but there are workarounds
http://www.telerik.com/community/forums/aspnet/panelbar/radpanelbar-for-dnn-how-to-automatically-expand-all-the-items-when-loading.aspx 

Taken from this page this might work in JavaScript. Did not test it just changed Collapse to Expand. Don't know if there is such a thing.

<script type="text/javascript"
function CollapseAllItems() 
 
    var panelbar = <%= RadPanelbar1.ClientID %>
    for (var i=0; i<panelbar.AllItems.length; i++) 
     
        panelbar.AllItems[i].Expand(); 
     
 
</script>

I usualy dont want all to be expanded. 

Markus
Posted by Community Admin on 05-Sep-2012 00:00
Thanks Again.
I will try this.
Posted by Community Admin on 07-Sep-2012 00:00
Can't get it to work. I tried putting a script widget with this:
var panelbar= document.getElementById("T1CF96E6D009");
 
for (var i=0; i<panelbar.AllItems.length; i++)
    
        panelbar.AllItems[i].Expand();
    
and this:
var panelbar= document.getElementById("T1CF96E6D009");
 
for (var i = 0; i < panelbar.get_allItems().length; i++)  
    if (panelbar.get_allItems()[i].get_items().get_count != 0)  
        panelbar.get_allItems()[i].set_expanded(true); 
     
 
and:
var panelbar= document.getElementById("T1CF96E6D009");
 
for (var i = 0; i < panelBar.get_allItems().length; i++)
           panelBar.get_allItems()[i].expand();
       
and nothing works.
I know this is the correct element, i used an alert to confirm it is finding it.
Posted by Community Admin on 07-Sep-2012 00:00
Dear Andrew

I would open a support ticket and link to this thread. They are way smarter then my guess work.

Markus
Posted by Community Admin on 07-Sep-2012 00:00
@Markus

The question was not directed at your specifically, thought perhaps someone else reading this would know.

But thanks for checking in again.
Posted by Community Admin on 16-Sep-2013 00:00
Just a quick message to say thank you very much Markus for this - a very useful tip indeed. I was scratching around for ages to replicate this when it was really very simple, once the rad controls were revealed.

Thanks again Markus.
This thread is closed