Please give some explanation of using CurrentPage property

Michael Petrov
Member since: 2009
 

I'm working with EPiServer Demo for a week or little more and very like it. But I have some problem with understanding some features. It would be great if anybody can give me an explanation.

I've made a simle website in two languages and included the QuickSearch control is delivered with the demo website. I created my own Search page for showing results.
My problem is: after submit the website is redirected to DEMO Search result page, but I would like to redirect it to my NEW Search result page (moreover in current language). I found some code in QuickSearch control:

PageReference searchPageRef = CurrentPage["SearchPage"] as PageReference;

if (searchPageRef != null)
{
PageData searchPage = GetPage(searchPageRef);
_searchPageUrl = searchPage.LinkURL;
}


The property CurrentPage["SearchPage"] returns DEMO Search result reference.

How can I set the property for example "MySearchPage" for getting my search page reference CurrentPage["MySearchPage"]?
Where in the admin tool is it possible to set that values for pages?
How the string id "SearchPage" is related to the DEMO Search page?


Under Site configuration section I found some settings:

Logotype 
Contact page  
Privacy page  
Site map page  
RSS Main Page

But there are no ways to add a new one.


Thank you

#29201 Apr 15, 2009 11:01
  • Petter Klang
    Member since: 2008
     

    Hi Michael,

    If you look at the comment for the SearchPageUrl you will see that is is by default set to take the PageReference pointed out by the dynamic property SearchPage.

    If you are in editmode and on your startpage click the "edit dynamic properties" button. (its the one with three blocks in different colors) and there you will see that the property SearchPage will be pointing to the default searchpage. So it's just to change this to point to your searchpage instead.

    Hope I made some sense.

    #29203 Apr 15, 2009 11:42
  • Anders Hattestad
    Member since: 1996
     

    CurrentPage[propname] gives you the underline value

    CurrentPage.Property[propname] gives you the Property

    #29204 Apr 15, 2009 12:06
  • Michael Petrov
    Member since: 2009
     

    Hi Petter,

    Thank you for your answer very much. I've found that Dynamic properties buttonCool

    #29205 Apr 15, 2009 13:00