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
Thanks for the cool package.
I modified the razor to filter by template. It could be tweaked to do doc types instead if you want.
@using umbraco.cms.businesslogic.template @{ var templatesNotToRender = new[] { Template.GetByAlias("Non Page").Id }; } @ListChildNodes(Model.AncestorOrSelf(1), templatesNotToRender) @helper ListChildNodes(dynamic startNode,int[] templatesNotToRender) { Response.ContentType = "text/xml"; const int maxLevelForSiteMap = 100; foreach (var node in startNode.Children .Where("HasAccess") .Where("!IsProtected") .Where("umbracoNaviHide == false") ) { if(node.template > 0 && ! templatesNotToRender.Contains((int)node.template)) { <url> <loc>@GetUrlWithDomainPrefix(node.Url)</loc> <lastmod>@(string.Format("{0:s}+00:00", node.UpdateDate))</lastmod> @if (node.SearchEngineSitemapChangeFreq.ToString() != "") { <changefreq>@node.SearchEngineSitemapChangeFreq</changefreq> } @if (node.SearchEngineSitemapPriority.ToString() != "") { <priority>@node.SearchEngineSitemapPriority</priority> } </url> } if (node.Level <= maxLevelForSiteMap && node.ChildrenAsList.Count > 0) { @ListChildNodes(node, templatesNotToRender) } } } @functions { private static string GetUrlWithDomainPrefix(string url) { if (url.StartsWith("/")) url = url.Substring(1); var domainPrefix = string.Format("http://{0}/", HttpContext.Current.Request.ServerVariables["HTTP_HOST"]); if (url.StartsWith(domainPrefix)) return url; else return domainPrefix + url; } }
is working on a reply...
Write your reply to:
Upload image
Image will be uploaded when post is submitted
Filter links by Template (or doc type)
Thanks for the cool package.
I modified the razor to filter by template. It could be tweaked to do doc types instead if you want.
is working on a reply...