Grabbing URL from node Options
colin@hoh.co.uk
Posted: Monday, October 08, 2007 7:56:23 PM
Rank: Newbie

Joined: 8/2/2006
Posts: 7
Hi
I'm putting together some code under an action handler (on the publish event) that saves data to a sql database for searching against.

I can save all of my own document attributes (title, bodytext etc) but I can't see how to record the page URL.

I thought that I could either use the umbraco objects to extract the URL and store it as a string or grab the node id and then render this when the results are returned as the URL.

Either way I am struggling to find my way around the umbraco API library.

Any help appreciated.

Colin

p.s. as there is so little documentation on umbraco, is this the sort of thing you can learn on the Umbraco developer course???
drobar
Posted: Monday, October 08, 2007 8:47:04 PM

Rank: Umbracoholic

Joined: 9/8/2006
Posts: 1,831
Location: MA, USA
I don't have an answer for you re: action handlers... but for searching, why not use XSLTsearch (http://umbraco.percpientstudios.com/xsltsearch.aspx) or the Lucene-based search in the umbraco utilities? It seems a waste to duplicate so much data just for searching.

cheers,
doug.

MVP 2007-2009 - Percipient Studios
colin@hoh.co.uk
Posted: Tuesday, October 09, 2007 11:12:16 AM
Rank: Newbie

Joined: 8/2/2006
Posts: 7
Hi Doug

Thanks for your post. We are actually replacing your xslt search which stood us in good stead and was very quick. However the data needs to be shared with other systems and so we are storing it externally from Umbraco plus we're better with c# and sql than we are with XSLT! - or so I thought :!:

Cheers

Colin
mortenbock
Posted: Tuesday, October 09, 2007 2:53:38 PM

Rank: Addict

Joined: 7/19/2006
Posts: 811
Location: Århus, Denmark
Well...

If you have the ID of the node, then you should be able to get the url by using

umbraco.library.NiceUrl()

The same method that you would use in an xslt navigation...

Morten Bock - Level 2 certified - MVP 2008/2009 - My danish blog with a few english posts

colin@hoh.co.uk
Posted: Wednesday, October 17, 2007 12:17:29 PM
Rank: Newbie

Joined: 8/2/2006
Posts: 7
thanks Morten - you are absolutely right and this is what we did in the end.

We didn't have all of our libraries referenced properly which lead us to not getting the library calls to work properly - school boy error!

Thanks

Colin
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.