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-newsto 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-newsHowever, 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.
- As per this article: Is there a way to customize URLs by Web Content Structures?, you could manually include the desired separator in each web content's friendly URL, to result in this URL:
http://localhost:8080/w/news-details/breaking-news
However, this is a manual process and might be difficult to maintain.