Best property type for internal page links?


Hi everyone

Quick bit of advice which I'm sure will be an easy one for you all.

We've been using Property Type -> 'URL to page/external addres' to link href's on pages to other pages within our EPiSERVER site, however now have the interesting challenge where these links are being rendered without the /en/ or other country information in the URLs.

Rather than writing our own custom function to grab the Properties as Pages (say by setting them as Type 'Page') is there a _recommended_ way/Property Type to use that keeps true to the current language by default?

Sure it's obvious but not so far to us! Alex

Apr 27, 2010 19:07

.. and to give a couple of examples:


<%# CurrentPage.Property["OurOtherPageLink"] %>

produces a nice SEO friendly URL but with no Globalisation and


<EPiServer:Property ID="OurOtherPageLink1" PropertyName="OurOtherPageLink" runat="server" />

products an internal looking URL with the .aspx on the end and the page ID as a get parameter.

What we'd like to get is as the first one, with a nice SEO friendly URL, but also include the Globalisation information :-)

Apr 27, 2010 19:25

Use the Page property type for this.

Apr 27, 2010 21:31

Thanks Frederik - so should have had you come and help us out with this job :-)

Do you have an example to share?


Apr 27, 2010 22:03

Hehe, seems you're doing alright by yourself :).

Simply use the EPiServer property control to render the url.

<EPiServer:Property runat="server" PropertyName="MyPageProperty" />

You can also use it in your code-behind.

var myPageReference = (PageReference)CurrentPage["MyPageProperty"];

var myPage = GetPage(myPageReference);

myPage.LinkURL gives you the url.

Hope this helps.


Apr 27, 2010 22:13

We're learning fast :-) [largely thanks to your great blog posts :->]

As you couldn't make this gig, drinks on me in London next time you are over :-) :-)


Apr 27, 2010 22:36

Haha, I'll take you up on that one! :)


Apr 27, 2010 23:09
* 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.