Search code examples
c1-cms

Alias/Redirect Page Type in Composite C1


I have the following structure:

Area - Page 1 - Page 2 - Page 3

Navigating to Area should be equivalent to navigating to Page 1.

I don't want to solve it using Routes, because I want an editor to be able to set up a similar structure and edit "Area" to point to "Page 1".

How can I create a Page Type where I can set a target page as a setting, and make the page result in a redirect instead of page content?


Solution

  • You would insert the function named Composite.Web.Response.Redirect into the page content of Area.

    You would need to switch to Source Mode of the page to be able to insert it, since the function doesn't return anything and the function-selector in Visual Mode only shows functions that returns actual content.