Press Ctrl / CMD + C to copy this to your clipboard.
This post will be reported to the moderators as potential spam to be looked at
I have installed razor version and my homepage is not included in sitemap.
Structure is as is suggested on umbraco tutorials
Content Homepage About us Contact ....
Is it this wrong structuring of pages ?
xslt is working well if i remove [@level=1] (it shows in this case homepage)
I am new in umbraco, and i am going to razor scripting. I do not plan to use xslt ...
Thank You
Sorry misread the forum post. Please remove this post :).
Question is:
What i must change in razor script that will include Homepage ...
Or i use wrong page structure:
suggested in tutorials, that i use:Content -Homepage -About us -Contact ....
and i see that nav, sitemap and other default scripts are prepared for this structureContent -Homepage -About us -Contact ....
Please can anyone suggest me what is right page structuring !?
Hi Denis,
EDIT: previous version was not correct and generated duplicated pages. This one is hopefully correct, not 100% sure as I don't have the same structure as you:
Paste the following code before calling the helper (on the very beginning):
@GetUrlWithDomainPrefix(Model.Parent.Url) @if (Model.Parent.SearchEngineSitemapChangeFreq.ToString() != "") { @Model.Parent.SearchEngineSitemapChangeFreq } @if (Model.Parent.SearchEngineSitemapPriority.ToString() != "") { @Model.Parent.SearchEngineSitemapPriority }
Not the most elegant solution but it works.
Cheers,Sara
Hey,
I had the same issue. Changing this line:
@ListChildNodes(Model.AncestorOrSelf(1))
To this:
@foreach (Node topNode in new umbraco.NodeFactory.Node(-1).Children)
{
if (topNode.GetProperty("umbracoNaviHide").Value != "true")
<url>
<loc>@GetUrlWithDomainPrefix(topNode.Url)</loc>
<lastmod>@(string.Format("{0:s}+00:00", topNode.UpdateDate))</lastmod>
@if (topNode.GetProperty("searchEngineSitemapChangeFreq") != null)
if (topNode.GetProperty("searchEngineSitemapChangeFreq").ToString() != "")
<changefreq>@topNode.GetProperty("searchEngineSitemapChangeFreq")</changefreq>
}
@if (topNode.GetProperty("searchEngineSitemapPriority") != null)
if (topNode.GetProperty("searchEngineSitemapPriority").ToString() != "")
<priority>@topNode.GetProperty("searchEngineSitemapPriority")</priority>
</url>
var theNode = @Model.NodeById(topNode.Id);
@ListChildNodes(theNode)
Seemed to do the trick for me!
Cheers
is working on a reply...
Write your reply to:
Upload image
Image will be uploaded when post is submitted
Razor script not include Homepage
I have installed razor version and my homepage is not included in sitemap.
Structure is as is suggested on umbraco tutorials
Content
Homepage
About us
Contact
....
Is it this wrong structuring of pages ?
xslt is working well if i remove [@level=1] (it shows in this case homepage)
I am new in umbraco, and i am going to razor scripting. I do not plan to use xslt ...
Thank You
Sorry misread the forum post. Please remove this post :).
Question is:
What i must change in razor script that will include Homepage ...
Or i use wrong page structure:
suggested in tutorials, that i use:
Content
-Homepage
-About us
-Contact
....
and i see that nav, sitemap and other default scripts are prepared for this structure
Content
-Homepage
-About us
-Contact
....
Please can anyone suggest me what is right page structuring !?
Hi Denis,
EDIT: previous version was not correct and generated duplicated pages. This one is hopefully correct, not 100% sure as I don't have the same structure as you:
Paste the following code before calling the helper (on the very beginning):
@GetUrlWithDomainPrefix(Model.Parent.Url)
@if (Model.Parent.SearchEngineSitemapChangeFreq.ToString() != "")
{
@Model.Parent.SearchEngineSitemapChangeFreq
}
@if (Model.Parent.SearchEngineSitemapPriority.ToString() != "")
{
@Model.Parent.SearchEngineSitemapPriority
}
Not the most elegant solution but it works.
Cheers,
Sara
Hey,
I had the same issue. Changing this line:
@ListChildNodes(Model.AncestorOrSelf(1))
To this:
@foreach (Node topNode in new umbraco.NodeFactory.Node(-1).Children)
{
if (topNode.GetProperty("umbracoNaviHide").Value != "true")
{
<url>
<loc>@GetUrlWithDomainPrefix(topNode.Url)</loc>
<lastmod>@(string.Format("{0:s}+00:00", topNode.UpdateDate))</lastmod>
@if (topNode.GetProperty("searchEngineSitemapChangeFreq") != null)
{
if (topNode.GetProperty("searchEngineSitemapChangeFreq").ToString() != "")
{
<changefreq>@topNode.GetProperty("searchEngineSitemapChangeFreq")</changefreq>
}
}
@if (topNode.GetProperty("searchEngineSitemapPriority") != null)
{
if (topNode.GetProperty("searchEngineSitemapPriority").ToString() != "")
{
<priority>@topNode.GetProperty("searchEngineSitemapPriority")</priority>
}
}
</url>
var theNode = @Model.NodeById(topNode.Id);
@ListChildNodes(theNode)
}
}
Seemed to do the trick for me!
Cheers
is working on a reply...