How to best do a list of pages with different page types

Vote:
 

Is it possible to create a list of pages with different pagetypes using ex. pagelist?

What i want is to have a section with "help items", where a page is created for each item. Some items will use a page type with a image link, a limited xhtml text, and some items might use a page type with some other properties (we need to do this very fixed, and thus wants to use maybe 3-5 different templates that the editor can choose between).

These pages will be displayed by their templates when shown one at a time, but i want them to keep the same look in a list of these items.

Will i have to use a pagelist and check for page type and render them differently, or is this built in in some way when i allready have created templates for them?

This might be a stupid question, but as im new to EPiServer and cant find any descriptions of this i have to ask Embarassed

Feel free to give best practises for solving such problem, or point me to another page/thread.

 

#27700
Feb 06, 2009 14:41
Vote:
 

Hi

there are seveal ways you can archive what you want if I have understood you correctly. One solution that works but aint easy to change is to make your own function

<ItemTemplate>
<%#OwnFunction(Container.CurrentPage)%>
<ItemTemplate>

and return the string you want to display pr each item.

antother solution is to make your own PageList and make it use other templates for spesific page types. Like the code bellow does for FAQ page type.

If you want to only so 2 pages types you can modify

PageDataCollection pages = base.GetPages();

to filter for those 2 pages types

<ItemTemplate>
Other types
<ItemTemplate>
<ItemFAQType>
FAQ Type
<ItemFAQType>

Code here. unreadibly in this editor

http://paste2.org/p/143904

 

 

#27710
Edited, Feb 08, 2009 14:49
* 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.