Liferay is our portal solution. Portals are good at aggregating content from various sources. Generally, portal pages are comprised of various portlets and often one of the portlets will contain a piece of web content, such as an article or similar. This method of creating pages from disparate sets of portlets is a little bit different for most web content managers, who are used to thinking of a web page as a single piece of content, not as a group of sometimes different content items.
One of the challenges is how to provide a URL that links to a page that displays a single piece of content – a “display page” that features just that content. Liferay 6.1 solves this issue by creating “display pages” that have “canonical URLs”. This tutorial walks you through using that feature.
It also highlights a glitch that we’ve discovered. We cannot get links to the content on the display page to just display the canonical URL. If you know what we’re doing wrong, please let us know.
Step one: create a display page
- In your page treee, you will need one page that is a display page. This will be the page that displays the pieces of web content that you would like to see on the page.
- Create a page called “Display”.
- Put an asset publisher on it.
- Check these two boxes:
– Show only assets with “Display” as its display page.
– Set as the Default Asset Publisher for This Page.
- The only required choice is the “Default Asset Publisher for this Page”.
- You can add other portlets to the page as well.
Create web content or edit existing web content
You need to make sure that the web content has the display page set for it. Edit the Web Content.
- Click on “Display Page” on the right.
- Click Select.
- Select the Display Page that you just created (called “Display” above).
- Click OK.
Verify “Canonical URL”
To verify the canonical URL, click on “View content in Display” in the Display Page settings.
You should see the content displayed in a format that looks like this:
https://my.law.emory.edu/web/bjchapm/-/article-1, where the canonical URL is “<SITE_NAME>/-/article-1”.
So, the URL is a dash followed by a slash, followed by the slugified title of the piece of content.
Problem: I cannot get the canonical URL to display any other way than by using “View content in Display”
For whatever reason, if I use the content publisher or other mechanism to get at the content, I do not see the canonical URL. I have posted a request for help with this on the forum pages. To see the way this is supposed to work, see these 6.1 User Guide pages.
This does not affect the validity of these URLs. I can manually type in <SITE_URL>/-/web-content-title-with-dashes and it works fine. It’s just that it seems like links should go to this URL, and not to the long ugly Liferay standard URLs.