Foren

Display Page does not show canonical URL

thumbnail
Ben Chapman, geändert vor 10 Jahren.

Display Page does not show canonical URL

New Member Beiträge: 23 Beitrittsdatum: 08.03.11 Neueste Beiträge
Friends,

I have manually created a page to be a display page. It is named "Display". I added an asset publisher and I ticked the "Set as the Default Asset Publisher for This Page" box. I created multiple pieces of web content. I set the display page for each piece of content to be "Display". When I click on "View Content in Display", I get the canonical URL:



However, if I am displaying the content as the result of clicking the "Read More" link in an asset publisher, I get the big long URL that is not the canonical URL:

https://my.law.emory.edu/web/bjchapm/articles/-/asset_publisher/GAOrNFj1l9zh/content/article-1?redirect=https%3A%2F%2Fmy.law.emory.edu%2Fweb%2Fbjchapm%2Farticles%3Fp_p_id%3D101_INSTANCE_GAOrNFj1l9zh%26p_p_lifecycle%3D0%26p_p_state%3Dnormal%26p_p_mode%3Dview%26p_p_col_id%3Dcolumn-2%26p_p_col_count%3D1

Why is this? Am I doing something wrong? This does not seem to be the expected behavior as documented here:

http://www.liferay.com/documentation/liferay-portal/6.1/user-guide/-/ai/lp-6-1-ugen03-display-settings-0

Is it because we are using HTTPS?

Thank you for any suggestions you have.

Ben
thumbnail
Wieteke den Uijl, geändert vor 10 Jahren.

RE: Display Page does not show canonical URL

Junior Member Beiträge: 56 Beitrittsdatum: 19.04.11 Neueste Beiträge
Hi Ben,

Have you configured the Asset Publisher so it shows content in a specific portlet by selecting "view in specific portlet" as asset link behaviour? However in my case this does not completely solve the issue. Each web content item is now available at its own canonical URL, but if you click on the read more-link in an asset publisher it still shows a redirect-part after the canonical URL. Does anyone know how to solve this?
ANIS HANTACH, geändert vor 9 Jahren.

RE: Display Page does not show canonical URL

New Member Beiträge: 2 Beitrittsdatum: 05.02.15 Neueste Beiträge
I solved the porblem , to display the canonical url in the asset publisher , you need to make a hook for the folder display of asset_publisher and recalculate the viewURL to passed in parameter the currentURL

String viewURL = assetRenderer.getURLViewInContext(liferayPortletRequest, liferayPortletResponse, currentURL)
thumbnail
Juan Gonzalez, geändert vor 9 Jahren.

RE: Display Page does not show canonical URL

Liferay Legend Beiträge: 3089 Beitrittsdatum: 28.10.08 Neueste Beiträge
Hi Anis,

instead of that hook, did you try to changing the Asset Publisher option "Link behaviour" to "View in context"?
ANIS HANTACH, geändert vor 9 Jahren.

RE: Display Page does not show canonical URL

New Member Beiträge: 2 Beitrittsdatum: 05.02.15 Neueste Beiträge
I try in the first with "View in context" but it gives the long URL