Sitemap for the site

Vote:
 

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.

 

#32930
Sep 24, 2009 17:14
Vote:
 

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

#32932
Sep 24, 2009 20:57
Vote:
 

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

#32940
Sep 25, 2009 11:28
Vote:
 

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.

#32943
Edited, Sep 25, 2009 13:19
Vote:
 
Could you please post me the code required for this change...i am new to EPi server  Frown
#32944
Sep 25, 2009 13:29
Vote:
 

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);
}
}

#32945
Edited, Sep 25, 2009 13:41
Vote:
 
Thanks Magnus, will implement it and will let you know the out put.
#32946
Sep 25, 2009 14:33
Vote:
 

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);
}

 

#32948
Sep 25, 2009 15:03
* You are NOT allowed to include any hyperlinks in the post because your account hasn't associated to your company. User profile should be updated.