Download a public templates pack - for instance this one, which contains a very basic site map example:
http://world.episerver.com/Download/Items/EPiServer-CMS/Version-5/EPiServer-CMS-5-R1/EPiServer-CMS-5-R1---Public-Templates/
Hope it helps,
/Marten
Hi Marten,
Thansk for your repply. I managed to get the Sitemap using page tree. But i have one problem.
We are using menu list for top menu on the site. The top menu was rendering the pages from right to left. So, our tema have given the sort index in teh reverse order and now the top menu is working fine. But the pages in the Sietmap are getting in reverse order. Cna you please suggest a solution for this.
Many Thanks
One way could be to hook into the Filter event of the control and rearrange the pages in the collection (reverse the order). If I were you I would do this in the top menu rather than the sitemap since the top menu is what does not follow the "expected" behaviour. Also it's flat (not hierarchial) so it would be fewer pages and simpler logic.
Edit: I'm not sure if this will work, perhaps the order is set after the Filter event, but it's worth a try.
This is completely untested code. It also assumes that the order presented in the menulist is the order the pages are in the collection, i.e. that ordering is done before this event handler is called. In that lucky case you should just be able to create an eventhandler that looks something like the below and connect the Filter event of your MenuList to it (for example in markup by setting OnFilter="ReverseOrder"):
using System.Linq;
protected void ReverseOrder(object sender, EPiServer.Filters.FilterEventArgs e)
{
PageDataCollection reversed = (PageDataCollection)e.Pages.Reverse();
e.Pages.Clear();
foreach (PageData p in reversed)
{
e.Pages.Add(p);
}
}
Hi Magnus,
The above code worked with some midifications. Thanks for your favourable help. Below is the modified code.
Thanks Again.
PageDataCollection correctPageOrder = (PageDataCollection)e.Pages;
PageDataCollection reversePageOrder = new PageDataCollection(e.Pages.Count);
for (int i = e.Pages.Count-1; i >= 0; i--)
{
reversePageOrder.Add(correctPageOrder[i]);
}
e.Pages.Clear();
foreach (PageData p in reversePageOrder)
{
e.Pages.Add(p);
}
Hi All,
Can you please tell me how to generate the Site Map for the EPi server driven web site. My requirement is this particular site map should contain links to all the existing pages and for the pages to be created. I mean this should be dynamic enough.
Please get back to me on this as soon as possible.
Many thanks in advance.