That is that way I was doing it. BUt becasue we have language site, when you copied across the whole ourt services folder from the UK to say, German, the nav on german pages would display the uk nav, becasue of the hardcoded node id value.
I have just signed up to get the videos and this worked for me.
That is that way I was doing it. BUt becasue we have language site, when you copied across the whole ourt services folder from the UK to say, German, the nav on german pages would display the uk nav, becasue of the hardcoded node id value.
I have just signed up to get the videos and this worked for me.
Display child nodes as links for current folder
Hi,
I am new to umbraco and razor, I have has a look around but cant find the answer to my question.
I have a the following website structure, which I am building the new pages in "our services "
I want to display the child pages of our services as nav, I have the following code
Hi Simon, instead of having AncestorOfSelf you can have it like this..
var Node = @Model.NodeById(1030);
@foreach (var page in Node.Children.Where("Visible"))
Just change the NodeById Number to what the "our services" page is.. which you will find in the page properties.
var Node = @Model.NodeById(1030);
<ul>
@foreach (var page in Node.Children.Where("Visible")) {
<li><a href="@page.Url">@page.Name</a></li>
}
</ul>
Sorry forgot to add rest of code...
Thanks Paul,
That is that way I was doing it. BUt becasue we have language site, when you copied across the whole ourt services folder from the UK to say, German, the nav on german pages would display the uk nav, becasue of the hardcoded node id value.
I have just signed up to get the videos and this worked for me.
<ul id="servicesNav">
@foreach (var page in @Model.Children) {
<li><a href="@page.Url">@page.Name</a></li>
}
</ul>
Thanks for your speedy responce, good to be part of a great communit.
Simon
Thanks Paul,
That is that way I was doing it. BUt becasue we have language site, when you copied across the whole ourt services folder from the UK to say, German, the nav on german pages would display the uk nav, becasue of the hardcoded node id value.
I have just signed up to get the videos and this worked for me.
<ul id="servicesNav">
@foreach (var page in @Model.Children) {
<li><a href="@page.Url">@page.Name</a></li>
}
</ul>
Thanks for your speedy responce, good to be part of a great community.
This issue is now closed, thanks
Simon
Try this simon i would rename the main "homepages" like
"UK - Home" = "EN-GB"
"DE - Home" = "DE-DE"
string url = Request.ServerVariables["SERVER_NAME"].ToString();
if (url.ToLower().Contains("EN-GB"))
{
var Node = @Model.NodeById(1030);
<ul>
@foreach (var page in Node.Children.Where("Visible")) {
<li><a href="@page.Url">@page.Name</a></li>
}
</ul>
}
if (url.ToLower().Contains("DE-DE"))
{
var Node = @Model.NodeById(1110);
<ul>
@foreach (var page in Node.Children.Where("Visible")) {
<li><a href="@page.Url">@page.Name</a></li>
}
</ul>
}
is working on a reply...