Monday, August 14, 2006

Multipage selection property

Have you ever wanted to store multiple page references in one property in EPiServer? I know I have many a time, but EPiServer doesn't provide you with a property to do this, so I ended up creating one myself.

Nick Urry and I have created a new property that pops up a new window that allows the user to select multiple EPiServer pages. The selected pages are stored in a single LongString property in XML format.

The XML format used is similar to a hyperlink HTML tag as using this format gives you a few things for free. One is that you can take the XML and render it into some HTML with little change required and the output would be a list of hyperlinks. The other advantage is that when doing an export or mirroring, the EPiServer code is designed to map these types of links in your properties to the new pages in the destination site! Trying to do this yourself would bring on a massive headache.

Heres an example of the content of the saved property:
<links>
<a href="/templates/Page.aspx?id=16">Tips and Trix</a>
<a href="/templates/news.aspx?id=92">News</a>
<a href="/templates/Page.aspx?id=6">Friendly URL!</a>
<a href="/templates/Page.aspx?id=4">About EPiServer 4.60</a>
</links>


The UI is designed so it shows you the number of selected pages in the property. You then click the expand button to edit the content. The dialogue that pops up displays the names of the selected pages with options to re-sort, delete and add new pages (I plan to add some better sorting to the dialog soon that does more than move up and move down).

So here are some screenshots of the property in its current state. The first one is showing the property in edit mode, the second is showing the popup that allows editing of the selected pages.

Multipage property displayed in edit mode

Multipage property editing dialog

So now you may be asking, can I have a copy, and where can I get it?

Well, this property has just been added to the EPiCode project so if you haven't already signed up, then sign up today and download the source.

9 comments:

Anonymous said...

Ohhh, sweeet. Can hardly wait.

Anonymous said...

This is nice. It is something I have wanted for a long time.

Anonymous said...

Great idea, just what i was looking for! Any chance though of this working in .NET 1.1 as well?

Jeremy said...

Yes, definately! There is nothing special about the property for it to require .NET 2.0. So to get it working under .NET 1.1 you will just need to create a new project, import the code and compile.

Anonymous said...

It seems like it isn't a straight forward convertion sadly

Anonymous said...

Hello! This is a very nice component that I have been using alot. I love it!

I have a problem though.. I now have a customer that needs a new web. (A newspaper web) The company only uses MAC computers so I need to use the EditX from reseach team. When I try using editX and Multipage the pages cannot be saved I get an aspx exception about a null reference in the validator, also the control only shows as a normal text field so u dont get any popup or anything (I am guessing thats why the validator complains).

Would it be possible to make a version that works with EditX? (If needed we can probably pay for this if it is not just a fast fix)

Anonymous said...

Great component! We have recently used in one of our projects and are very pleased with it. We have had one problem though; we can't get the language selector to work correctly. No matter if we choose English or Automatic in the selector, the links always point to the swedish versions of the pages. Any ideas about this?

Anonymous said...

"a new property that pops up a new window that allows the user to select multiple EPiServer pages." Does this mean that you can't select external webpages?

Jeremy said...

No, it has been extended to include external web pages and links.