掲示板
Multilingual friendly urls for portal pages
14年前 に Sampsa Sohlman によって更新されました。
Multilingual friendly urls for portal pages
Regular Member 投稿: 230 参加年月日: 07/09/27 最新の投稿
Hello all
Because of the Blog of Jorge Ferrer and related comment. I decided to write my suggestion how to make multilingual friendly urls to Liferay portal page.
At "Manage pages" there are fields "Name" and "HTML title" which can have multilingual values, but friendlyurl cannot. ´The case of friendly is little bit more compicated, because url has to be unique, which means that page's friendlyurl should be unique. There is also issue that differnent languages can have same words like Spanish has "flor" and Portuguese has "flor" (which both means flower) and also cases that same word on different languages might have different meaning too. So to solve this locale information should also binded to page's friendly url. So this could be done on following way.
Example 1: page flower on different languages
or there might be solution to add that locale to first like current solution, but I believe that it would fit better to Liferay architecture to add locale after the group. So second option would look like.
Example 2:
And of course the url http://localhost:8080/web/guest/es_es/flower or http://localhost:8080/es_es/web/guest/flower would not work, because the friendly url is language based.
When using virtual hosting for communities, friendly url would look following.
What if the every or some languages would like to have their own virtual host. Example:
If there is only one language defined then the locale information would not be visible on url.
Tecnically this could be implemented by moving frienldyurl from Layout entity to new FriendlyUrl entity, which would then point to Layout. This way the database index would also look after integrity of url. I have't dug very deep to source to look where else it would effect.
This kind of feature would be very usefull for me and my clients With current Liferay design the friendly url might be in Finnish but content is Basque, which is not good.
If you have ideas let's discuss at here.
- Sampsa
Because of the Blog of Jorge Ferrer and related comment. I decided to write my suggestion how to make multilingual friendly urls to Liferay portal page.
At "Manage pages" there are fields "Name" and "HTML title" which can have multilingual values, but friendlyurl cannot. ´The case of friendly is little bit more compicated, because url has to be unique, which means that page's friendlyurl should be unique. There is also issue that differnent languages can have same words like Spanish has "flor" and Portuguese has "flor" (which both means flower) and also cases that same word on different languages might have different meaning too. So to solve this locale information should also binded to page's friendly url. So this could be done on following way.
Example 1: page flower on different languages
http://localhost:8080/web/guest/en_us/flower
http://localhost:8080/web/guest/es_es/flor
http://localhost:8080/web/guest/pt_pt/flor
or there might be solution to add that locale to first like current solution, but I believe that it would fit better to Liferay architecture to add locale after the group. So second option would look like.
Example 2:
http://localhost:8080/en_us/web/guest/flower
http://localhost:8080/es_es/web/guest/flor
http://localhost:8080/pt_pt/web/guest/flor
And of course the url http://localhost:8080/web/guest/es_es/flower or http://localhost:8080/es_es/web/guest/flower would not work, because the friendly url is language based.
When using virtual hosting for communities, friendly url would look following.
http://mysite.local:8080/en_us/flower
http://mysite.local:8080/es_es/flor
http://mysite.local:8080/pt_pt/flor
What if the every or some languages would like to have their own virtual host. Example:
http://us.mysite.local:8080/flower
http://es.mysite.local:8080/flor
http://pt.mysite.local:8080/flor
If there is only one language defined then the locale information would not be visible on url.
http://localhost:8080/web/guest/flower
Tecnically this could be implemented by moving frienldyurl from Layout entity to new FriendlyUrl entity, which would then point to Layout. This way the database index would also look after integrity of url. I have't dug very deep to source to look where else it would effect.
This kind of feature would be very usefull for me and my clients With current Liferay design the friendly url might be in Finnish but content is Basque, which is not good.
If you have ideas let's discuss at here.
- Sampsa
14年前 に Lisa Simpson によって更新されました。
RE: Multilingual friendly urls for portal pages
Liferay Legend 投稿: 2034 参加年月日: 09/03/05 最新の投稿
I'm currently having a rant about this very issue myself... You can find it here.... Poor Dimtry... try doing this in Cyrillic characters....
14年前 に Jorge Ferrer によって更新されました。
RE: Multilingual friendly urls for portal pages
Liferay Legend 投稿: 2871 参加年月日: 06/08/31 最新の投稿
Hi Sampsa,
Thanks a lot for your analysis. Using a locale at the beginning of the URL path is actually already supported in 5.2, and will be added by default for all languages other than the default in 5.3.
Regarding the implementation I can see a few challenges. First, as you say, we would need two new entities: LayoutFriendlyURL and GroupFriendlyURL. They would have the following columns:
GroupFriendlyURL
- companyId (not absolutely needed, but added for performance reasons following the current patterns)
- groupId
- languageId
- friendlyURL
LayoutFriendlyURL
- companyId (not absolutely needed, but added for performance reasons following the current patterns)
- groupId (not absolutely needed, but added for performance reasons following the current patterns)
- plid
- languageId
- friendlyURL
Then, the FriendlyURLServlet would need to be modified so that it's aware of the locale and can search for the appropriate group and layout using the new entities.
In any case, it seems quite doable. Sampsa, if you have the time, it would be very helpful if you could take a deeper look and find out if there are any pending challenges that would need further consideration.
Thanks a lot for your analysis. Using a locale at the beginning of the URL path is actually already supported in 5.2, and will be added by default for all languages other than the default in 5.3.
Regarding the implementation I can see a few challenges. First, as you say, we would need two new entities: LayoutFriendlyURL and GroupFriendlyURL. They would have the following columns:
GroupFriendlyURL
- companyId (not absolutely needed, but added for performance reasons following the current patterns)
- groupId
- languageId
- friendlyURL
LayoutFriendlyURL
- companyId (not absolutely needed, but added for performance reasons following the current patterns)
- groupId (not absolutely needed, but added for performance reasons following the current patterns)
- plid
- languageId
- friendlyURL
Then, the FriendlyURLServlet would need to be modified so that it's aware of the locale and can search for the appropriate group and layout using the new entities.
In any case, it seems quite doable. Sampsa, if you have the time, it would be very helpful if you could take a deeper look and find out if there are any pending challenges that would need further consideration.
14年前 に Sampsa Sohlman によって更新されました。
RE: Multilingual friendly urls for portal pages
Regular Member 投稿: 230 参加年月日: 07/09/27 最新の投稿
Hi Jorge
For sure I will look on to this. It will be usefull feature
You also did add the multilingual frienlyurl for group, which is good.
So the plain url would then look following.
Quick guestion?
Why to group's friendlyurl is on Group entity and virtualhost is located at LayoutSet?
The encoding issue that Lisa mentioned has to be also taken account.
- Sampsa
For sure I will look on to this. It will be usefull feature
You also did add the multilingual frienlyurl for group, which is good.
So the plain url would then look following.
http://localhost:8080/<locale>/web|group/<localized name for group>/<localized name for page>
</localized></localized></locale>
Quick guestion?
Why to group's friendlyurl is on Group entity and virtualhost is located at LayoutSet?
The encoding issue that Lisa mentioned has to be also taken account.
- Sampsa
14年前 に Zsolt Balogh によって更新されました。
RE: Multilingual friendly urls for portal pages
Expert 投稿: 463 参加年月日: 09/03/23 最新の投稿Sampsa Sohlman:
Why to group's friendlyurl is on Group entity and virtualhost is located at LayoutSet?
There's one friendly URL for the group, but there are 2 layoutSets - the public and the private. This way you can create one virtual host for your public and one for private pages.
The friendlyUrl is the same for the public and private pages because from the /web/ or /group/ portal knows it's a public or a private layoutset, there's no need to have 2 names.
14年前 に Sampsa Sohlman によって更新されました。
RE: Multilingual friendly urls for portal pages
Regular Member 投稿: 230 参加年月日: 07/09/27 最新の投稿
Thanks, that is also clearly explained at Control panel's "Edit Pages for Community"
- Sampsa
- Sampsa
13年前 に charles de courval によって更新されました。
RE: Multilingual friendly urls for portal pages
Junior Member 投稿: 55 参加年月日: 10/07/31 最新の投稿
Hi ,
I'm cuttently having the same problem where I'm trying to have friendly url in both french and english. i'm using Liferay 6.0.5 and I'm wonderring if this issue has been fixed and if so, how to implement it?
thanks
I'm cuttently having the same problem where I'm trying to have friendly url in both french and english. i'm using Liferay 6.0.5 and I'm wonderring if this issue has been fixed and if so, how to implement it?
thanks
13年前 に Jorge Ferrer によって更新されました。
RE: Multilingual friendly urls for portal pages
Liferay Legend 投稿: 2871 参加年月日: 06/08/31 最新の投稿
Hi Charles,
Liferay does not support having more than one friendly URL for the same page at once. This thread is a proposal to implement such functionality to allow entering one friendly URL per supported language, but it hasn't been implemented yet.
Jorge
Liferay does not support having more than one friendly URL for the same page at once. This thread is a proposal to implement such functionality to allow entering one friendly URL per supported language, but it hasn't been implemented yet.
Jorge
13年前 に Sampsa Sohlman によって更新されました。
RE: Multilingual friendly urls for portal pages
Regular Member 投稿: 230 参加年月日: 07/09/27 最新の投稿
As I know nothing has done for this, may be to create improvement issue to Jira.
11年前 に Denis Signoretto によって更新されました。
RE: Multilingual friendly urls for portal pages
Expert 投稿: 375 参加年月日: 09/04/21 最新の投稿Sampsa Sohlman:
As I know nothing has done for this, may be to create improvement issue to Jira.
Hi Sampsa,
do you know if some improvement about this issue will be available on next release (6.2) ?
Thanks,
Denis.
11年前 に Mika Koivisto によって更新されました。
RE: Multilingual friendly urls for portal pages
Liferay Legend 投稿: 1519 参加年月日: 06/08/07 最新の投稿
Denis, the work has not been started yet so it's hard to say whether it makes 6.2 or not.
11年前 に Denis Signoretto によって更新されました。
RE: Multilingual friendly urls for portal pages
Expert 投稿: 375 参加年月日: 09/04/21 最新の投稿
Thank you Mika.
Do you know if there is an already opened issue I can follow (watch on Jira)?
Thanks,
Denis.
Do you know if there is an already opened issue I can follow (watch on Jira)?
Thanks,
Denis.
11年前 に Sampsa Sohlman によって更新されました。
RE: Multilingual friendly urls for portal pages
Regular Member 投稿: 230 参加年月日: 07/09/27 最新の投稿Denis Signoretto:
Do you know if there is an already opened issue I can follow (watch on Jira)?
There is clearly need for for this for these kind of feature, but as I know of there is still no jira issue of it. We could continue this thread and make a little specification and put it then through Liferay's product managment and hope that it then would turn up to product.
I have actually made a little proof of consept of the site part of this feature and I call it SiteURL. SiteUrl is to manage url + locale (+ redirect etc.) to site. This you can find out from git hub. https://github.com/sammso/liferay-portal/tree/6.1.1-ga2-siteurl. This is still missign page friendly url, but I think it is doable. Disclaimer: It is partially working and it is not done yet, but you can take a look. If you are running it you have to fill siteurl table from LR database. I'm currently Liferay employee so I have to mention that this feature is my personal experiment there is no guarantee that it will ever come part of the product..