Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

location of QuickLaunch contents/attributes 2

Status
Not open for further replies.

JonathanHerschel

Programmer
Mar 29, 2007
33
US
My client would like the QuickLaunch to be collapsible/expandable. Unfortunately, this cannot be done (tried to modify to treeview per ms website, but no luck).

When a person selects, SITE SETTINGS-> MODIFY SITE SETTINGS->NAVIGATION, he/she can customize the QuickLaunch and move links up/down, add, delete, hide, etc..

Where is this 'setting' stored? In the SQL database?

I would like to create a web part that grabs this info and creates a quicklaunch that is expandable / collapsible

Example
[+] Documents
- Shared Docs
- Doc lib 2
[-] Lists
[-] Discussions
[+] Sites
- Site 1
- Area 51
- Site 3
[-] People and Groups

Thanks,
Jon Herschel

 
I figured it out (thanks to a friend of a friend, Ben) and in case some of you would benefit, here it its...

Code:
SPSite site = SPControl.GetContextSite(Context);

SPWeb web = site.OpenWeb();

SPNavigationNodeCollection nodes = web.Navigation.QuickLaunch;

foreach (SPNavigationNode node in nodes)

{

// Get Children if any

SPNavigationNodeCollection Children = node.Children;

if (Children.Count != 0)

{

if (node.IsVisible == true) // only display if visible & isExternal is set to true

{

writer.Write("<a href='" + node.url + "'>" + node.title + "<a/><br />");

foreach (SPNavigationNode child in Children)

{

if (child.IsVisible == true) // only display if set to true

{

writer.Write("<a href=\"" + child.Url + "\">" + child.Title + "</a><br />");

}

}

}

}

}

Regards,

Jonathan Herschel

Anexinet

 
Thanks for replying to your own thread with an answer. It's bound to help someone somewhere along the line.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top