Navigation in a Dropdown with events? Options
Dobly
Posted: Wednesday, September 03, 2008 8:35:00 AM
Rank: Newbie

Joined: 3/15/2008
Posts: 15
I have had some success in building a simple site in Umbraco with 2 levels of navigation along with the XSLT to achieve that. So far so good. But now I have to do something a tad more complex and I'm not sure if it is out of the realms of Umbraco to do it.

What my client wants is for one level of the navigation to appear in a dropdown box. Not only that but they want an 'onClick' type event on it to load a new page everytime a new item is selected from the dropdown.

Now I could use XSLT to write out a dropdown list with my values in it. But how on earth would I get an 'On click' event attached dynamically to each?

I'm thinking I'll need a usercontrol for this. What do you think?

And if so, has anyone there got some example code that reads the umbraco xml file and extracts the navigation (or anything else for that matter)

Finally, is there an unbraco type dll that allows me to call umbraco specific functions from inside of Visual Studio?

Cheers.
Dirk
Posted: Wednesday, September 03, 2008 9:06:27 AM

Rank: Umbracoholic

Joined: 9/27/2007
Posts: 1,136
Location: Belgium
Hi Dobly,

Quote:
Now I could use XSLT to write out a dropdown list with my values in it. But how on earth would I get an 'On click' event attached dynamically to each?


I would write out the complete dropdown using xslt, attach an event handler to the onChange event of the dropdown (Here's just an example of what I mean).

Quote:
I'm thinking I'll need a usercontrol for this. What do you think?

And if so, has anyone there got some example code that reads the umbraco xml file and extracts the navigation (or anything else for that matter)


You could use that one too as well. Have a look at the umbraco API here. It's NOT a good idea to read the umbraco xml yourself!

Hope that helps.

Regards,
/Dirk

level 1 & 2 certified - umbraco MVP 2008/2009 - umbraco blog at netaddicts.be - working on an integrated forum4umbraco
Dobly
Posted: Thursday, September 04, 2008 1:24:17 AM
Rank: Newbie

Joined: 3/15/2008
Posts: 15
Dirk

When I said onClick, I actually meant an ASP.NET postback type of on Selection Change type of event. Despite that, I should not need to do a post back, just to redirect the use to a new page. (or run some Ajax function to update the main page with the correct data.)

Thanks for the your reply. Especially the bit about not reading the umbraco xml myself. It's little things like that that could get a new comer to umbraco in a world of pain and many hours wasted.

Users browsing this topic
Guest


You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.