November Happy Hour will be moved to Thursday December 5th.
November Happy Hour will be moved to Thursday December 5th.
The sourcecode is available at GitHub since it is open source. Download/Clone the repository and have a look at it:
Thank you Eric, I've been looking at GitHub Project, but not sure how to integrate this plugin to my project...so I asked for "step-by-step" process.
Neverless, I'll try it.
Regards
Hi Antonio,
I recently used it for one of my client's project. It is fairly straight forward.
1. Get the nugest package, but beware, you need to download the right version from nuget using version command. In my case I had used it for Episerver 7.5 so
I looked into version history to find out the right version compatible for 7.5.
2. Once the package is installed, you just need to compile your code and go to the CMS -> Admin Mode -> Search engine sitemap settings.
3. Click on the new sitemap button and add your site host name and it will generate the xml file for you.
4. Run the schedular service for it which is Generate search engine sitemaps.
Make sure the service runs without error.
5. It will give you a view link when it is done. You need to jump back on to Search Engine sitemap settings underneath Tool.
You will also get related information under the Git link that is posted above.
Any question please ask. Hope this will help.
Cheers,
Naz
The same goes for the source code except that you need to add that project to your solution and compile tha code. Once that is done and up and running you will be able to use it as mentioned above.
I've followed the steps mentioned by Naz with success.
And now, last step: what must I do, to render a simple page with same links I'm seeing in the view link, from Search engine sitemap settings???
I need a page that users can see, and can click the links to go to corresponding pages. I Apologize if it's obvious to you......but not to me.
Regards
Hi Antonio.
Our package is for generating XML sitemaps that helps Google, Bing, Yahoo etc to crawl the site better. The package doesn't contain a page template with clickable links. That is something you would have to create by yourself.
This is a very simple code sample to get you started written out of my head. I haven't tested it at all:
public class MenuItem { public ContentReference ContentLink { get; set; } public IEnumerable<MenuItem> Children { get; set; } }
[ContentType(DisplayName = "Sitemap", GUID = "73FC3DEE-BB8B-4874-B1BD-56BD5880F882")] public class SitemapPage : PageData { }
public class SitemapView { public IEnumerable<MenuItem> MenuItems { get; set; } }
public class SitemapController : PageController<SitemapPage> { private readonly EPiServer.Core.IContentLoader _contentLoader; public SitemapController(EPiServer.Core.IContentLoader contentLoader) { _contentLoader = contentLoader; } public ActionResult Index(SitemapPage currentPage) { var model = new SitemapView { MenuItems = GetMenuItemsRecursive(EPiServer.Web.SiteDefinition.Current.StartPage) }; return View(model); } private IEnumerable<MenuItem> GetMenuItemsRecursive(ContentReference contentLink) { var publishedFilter = new FilterPublished(); var accessFilter = new FilterAccess(); var menuItems = _contentLoader .GetChildren<PageData>(contentLink) .Where(p => p.VisibleInMenu && !publishedFilter.ShouldFilter(p) && !accessFilter.ShouldFilter(x)) .Select(p => new MenuItem { ContentLink = p.ContentLink, Children = GetMenuItemsRecursive(p.ContentLink) }); return menuItems; } }
And in your view:
@model SitemapView @helper SitemapMenuItem(MenuItem item, string itemCssClass, int currentDepth) { <li class="@itemCssClass"> @Html.ContentLink(item.ContentLink) @if (item.Children.Any()) { <ul class="sitemap-submenu depth-@currentDepth"> @foreach (var subItem in item.Children) { @SitemapMenuItem(subItem, "sitemap-submenu-item", currentDepth + 1) } </ul> } </li> } <h1>Sitemap</h2> <ul class="sitemap-menu"> @foreach (var item in Model.MenuItems) { @SitemapMenuItem(item, "sitemap-menu-item", 1) } </ul>
Hi Antonio,
This is just the XML file generated and it can be used for search engines.
If you need a sitemap with all the active links on your website, you need to write some piece of code. You need to traverse through each children and display them as a link.
Hope it make sense.
Cheers,
Naz
That's it Mattias, thank you!!!!!.....I just didn't understand exactly what the package is for.....
Cheers.
I'm wondering if there is a code sample using EPiServer Nuget
Geta.SEO.Sitemaps 1.3.0.4
I want to be able to add to my project a sitemap page using this plugin, but I'm not sure how it works. It would be nice to have a step-by-step proces on how to develop this functionality.
Thanks in advance