Specifying the URL pattern for content-only pages

Content-only page types do not have a presentation URL by default. This means that content editors cannot access content-only pages in the Preview mode or when opening them on the live site via the administration interface. Content editors also are not able to create page links using the text editor . If you want your content-only pages to support this functionality, you need to specify the URL pattern property of their page type when:

  • Using a standalone MVC application which handles the presentation of your content-only pages.
  • Using Portal Engine and employing content-only page types.

You will usually only want to specify the property for pages with a separate presentation. Pages that store content that is only used when aggregated on a different page may not need to have their own URL pattern specified. For example, such pages could represent individual branches/offices/cafes of a company that you aggregate on a page that displays all the branches/offices/cafes in one catalog.

Specifying the URL pattern property

  1. If your live site runs on a different domain than the administration instance (e.g. for MVC sites), make sure your site's Presentation URL is specified.
  2. Open the Page types application.
  3. Edit a content-only page type.
  4. Fill in the URL pattern under which you want the page to be accessible from the administration UI. You can use simple macro expressions for accessing data of the current page in the pattern, such as {%NodeGUID%} or {%DocumentModifiedWhen.Month%}. Complex macro expressions including macro methods are not available in the URL pattern. For example:

    /{%DocumentCulture%}/Articles/{%NodeAlias%}

    Resolves into URL ' http://www.example.com/en-US/Articles/On- Roasts' for a page in the 'en-US' culture with Node alias 'On Roasts'.

    The {%NodeAlias%} macro allows you to retrieve a page alias that you can use to create more SEO-friendly URLs.

    Note: We do not recommend using query string parameters in URL patterns. The system removes any parameters when generating Preview URLs for pages based on the pattern.

  5. Click Save.

Editors can now access the pages of this type from the administration UI using the Live site button. They can also insert links to the pages using the text editor, and work with page builder widgets on the Page tab.

The system may add a parameter to the resulting URL when displaying pages. For example, the viewmode parameter is added to the URL when you open a page on live site via the administration UI. The resulting URL may then look like this:

http://www.example.com/en-US/Articles/On- Roasts?viewmode=0

Adding support for preview mode

When developing an application that handles the presentation of content-only pages (for example when using the MVC development model), you need to manually enable the preview feature and ensure that the preview mode displays the latest versions of pages. For more information, see Adding preview mode support.

After you set the URL pattern for your content-only page types and enable the preview feature, the system can automatically generate preview URLs for the given pages. You can use the preview mode in two ways within the Pages application:

  • Switch to Preview mode using the main view mode selector.
  • Generate preview links for pages in Properties -> General -> Preview URL, which you can then send to other users. See: Sending links to unpublished pages

Note: Preview mode is not supported if you are using content-only page types on a Portal Engine site together with standard pages. In this scenario, you can instead use the preview of the pages that load and display the given content.


Was this page helpful?