legacy-knowledge-base
公開されました Sep. 10, 2025

Issue with Display Page Template URL for Web Content Articles

written-by

Ahmed Abdin

How To articles are not official guidelines or officially supported documentation. They are community-contributed content and may not always reflect the latest updates to Liferay DXP. We welcome your feedback to improve How To articles!

While we make every effort to ensure this Knowledge Base is accurate, it may not always reflect the most recent updates or official guidelines.We appreciate your understanding and encourage you to reach out with any feedback or concerns.

legacy-article

learn-legacy-article-disclaimer-text

Issue

  • I have an issue with the Display Page Template  URL. I have configured a Display Page Template named "Test News" to display the full article data for web content articles of type News. I assigned the friendly URL /test-news to the template.
  • Our setup:

  • The display page template is set as the default display page for the News content structure.

  • Each News web content article has a custom-friendly URL set individually (e.g., breaking-news).

  • On our site page, we use a Collection Display Fragment to show all News articles.

  • We added a button inside each card to redirect users to the full article view using the display page.

  • We expected the resulting URL to follow this format:

  • http://localhost:8080/test-news/${webcontent_friendly_url}
    e.g., http://localhost:8080/test-news/breaking-news
  • However, what we are getting instead is:

  • http://localhost:8080/en/e/test-news/29435/87124
  • Our goal:

  • We would like to achieve SEO-friendly URLs based on the web content-friendly URL, like:

  • http://localhost:8080/test-news/breaking-news

Environment

  • Liferay Quarterly Release 2025.q1

Resolution

  • The mentioned behavior is expected. You can set a friendly URL for your display page template. The friendly URL is used when the display page template is not marked as default or when it is manually selected for use.  
    That means, if you configure the Mapped URL for the redirect button and you select Display Page > Test News (or any other DPT), the URL will use the friendly URL the way you mentioned:
http://localhost:8080/en/e/test-news/29435/87124
Additional Information
  • Different elements have their own URL separators by default. The /e/ separator stands for the Display Page Template URL Separator.
  • The URL follows this format /web/mysite/e/{userDefinedURL}/assetTypeId/assetId - Unfortunately, this is not possible to change out of the box, but there is already a feature request opened to allow for more flexibility (LPD-43195).
    The other approach is to configure the Mapped URL for the redirect button as Display Page > Default, resulting in the URL:
http://localhost:8080/w/breaking-news

 This shows the friendly URL of web content with its default /w/ separator. It is possible to customize the URL separators as per this article: Configuring Friendly URL Separators, but this would be valid for all web contents and not only for those where the Display Page is selected to be Test News.

http://localhost:8080/w/news-details/breaking-news

However, this is a manual process and might be difficult to maintain.
 

did-this-article-resolve-your-issue

legacy-knowledge-base