Ask Questions and Find Answers
Important:
Ask is now read-only. You can review any existing questions and answers, but not add anything new.
But - don't panic! While ask is no more, we've replaced it with discuss - the new Liferay Discussion Forum! Read more here here or just visit the site here:
discuss.liferay.com
- Home
- General
- Feature Requests
- RE: Display page of content web from a structure created on the global site
RE: Display page of content web from a structure created on the global site
Liferay is very interesting when you have to manage a lot of sites
and users.
In this case, the use of site templates is ideal.
It is therefore possible to create Web contents that will be visible
on a particular site or on several sites of the same region, country
or entity.
All of this is possible using site hierarchies
(organizations) or assets libraries.
The problem in this case is
that the asset publisher will offer the content of the different sites
but their display page will not necessarily be on the current site or
the content can be created without a default display page.
We want that a user of a site always stay on the current site
with the right branding and not the site of the country or region. (if
the web content has been created on the country or the region)
Our
proposal would be that if the web content does not have a display page
but if a page of the current site is named like the name of the
structure of the current web content, instead of making an error, we
could display the content on this display page intended for.
For my client, we implemented this.
The structure was created on the global site and therefore without a
default display page, but we use a page with the same name as the name
of the structure created on the site template.
We have 500 sites
with this site template, this page is created on our 500 sites and
contains an asset publisher who display the detail of the active web
content.
So we overridden the native Liferay code in version
7.4u64 to do this.
It would be nice if it was Liferay native so that we don't need to
check that our code remains compatible with the new Liferay code.
To do this, we simply override the class
DefaultAssetDisplayPageFriendlyURLResolver.java and adapt the code to
find the article not in the current site but in the parents sites or
in the global. And for the display page, if none have been found, we
try to find a page in the current site with the name of the stucture
of the web content... so we search a page /web/my-current-site/structure-name-article.
If the stucture of the content is named "news", and the current site is "site-london" the url would be "/group/site-london/news" and the url of the content will be "/group/site-london/-/the-url-of-the-web-content" and not the url "/group/uk/..." or "/group/great-britain/..." or "/group/global/..." (I know, global site does not exist !)
Regards, Eric.
Hi Eric,
Thank you for the contribution!
Here is the related Jira ticket: https://issues.liferay.com/browse/LPS-185358