Other than using the content picker in umbraco can somehow explain how to point the url of the parent to the first child node instead?
The idea would be by using a boolean, so if the admin want the url to point to the child he only checked it and if not i will use the actual path of the parent.
I have the following in my razor file
if (childPage.Children.Count() > 0 || childPage.Where("skip")){ <ul> <li><a href="@childPage.Url.Down"><strong>@childPage.Name - </strong></a></li> @foreach(var sub in childPage.Children){ <li><a href="@sub.Url">@sub.Name</a></li> } </ul> }
Sorry for replying only now, was out of the office. Here is how my xslt looks like but am not trying to convert this xslt to razor. Am working on another project where the possibility of changing the Url of the parent to child node needs to be available.
Jump to First Child in Navi
Hi guys,
Other than using the content picker in umbraco can somehow explain how to point the url of the parent to the first child node instead?
The idea would be by using a boolean, so if the admin want the url to point to the child he only checked it and if not i will use the actual path of the parent.
I have the following in my razor file
Just for the record the property Alias "Skip" here is only to define a bold node if checked. My bad i didnt renamed it!
Can something like this be use to get the url ?
Try this:
This will use the URL of the first child, otherwise it will use the URL of the node itself if no children are present.
Hope this helps,
Benjamin
Fuji,
Can you post up your existing XSLT please?
Thanks,
Benjamin
Hi Benjamin,
Sorry for replying only now, was out of the office. Here is how my xslt looks like but am not trying to convert this xslt to razor. Am working on another project where the possibility of changing the Url of the parent to child node needs to be available.
Btw got it working here is the Razor File
//fuji
is working on a reply...