Foros de discusión

How to customize liferay url format

thumbnail
Satish Babu Anupoju, modificado hace 9 años.

How to customize liferay url format

Junior Member Mensajes: 79 Fecha de incorporación: 20/02/11 Mensajes recientes
Hi Team

I am working on ecommorce implementation. Where I need to form URL like liferay url format fashion : "https://www.liferay.com/about-us/newsroom/in-the-news".


As per our requirement my target url format should be like : http://www.domainname.com/location/category/sub-category/title. (This is SEO friendly url format)


Can anyone advice me how to implement this


Regards
Satish Babu
thumbnail
Ravi Kumar Gupta, modificado hace 9 años.

RE: How to customize liferay url format

Liferay Legend Mensajes: 1302 Fecha de incorporación: 24/06/09 Mensajes recientes
What you need is Friendly URLs.
thumbnail
Satish Babu Anupoju, modificado hace 9 años.

RE: How to customize liferay url format

Junior Member Mensajes: 79 Fecha de incorporación: 20/02/11 Mensajes recientes
Hi Ravi


Thanks for sharing the link.

Got the output as mentioned in the article and getting the url format like : http://localhost:8080/web/guest/welcome/-/ems/action/getEmployee/employeeId/5?p_auth=3PFjIsW1

From the above url employeeId parameter formatted like employeeId/5 .

But as per my requirement I need to form the url pattern like : http://www.domainname.com/location/category/sub-category/title

Want to construct a url with only values ( no keys)


Please let me know if you need more clarity.

Regards
Satish Babu
thumbnail
Ravi Kumar Gupta, modificado hace 9 años.

RE: How to customize liferay url format

Liferay Legend Mensajes: 1302 Fecha de incorporación: 24/06/09 Mensajes recientes
Liferay friendly urls start with /-/...

Now, <pattern>/action/{actionName}/employeeId/{empId:\d+}</pattern> in friendly url route.xml can be played with.

Why not use
<pattern>/{actionName}/{empId:\d+}</pattern>

Or anything that suits you. I am not sure whether this will work fine, but you can try. emoticon
thumbnail
Sandip Patel, modificado hace 9 años.

RE: How to customize liferay url format

Regular Member Mensajes: 205 Fecha de incorporación: 5/01/11 Mensajes recientes
Hi,
As Ravi has mentioned Liferay freindly URL start with start with /-/... So URL before it must be there as it is Liferay site name and page name. But you can create own customize URL in routes.xml as <pattern>/{location}/{category}/{category}/{title}</pattern>.

Your URL looks like http://www.domainname.com/web/guest/welcome/{location}/{category}/{category}/{title}. This format can be supported in SEO as Liferay's all type of URL support SEO.
Syam Kumar, modificado hace 8 años.

RE: How to customize liferay url format

New Member Mensajes: 8 Fecha de incorporación: 9/12/11 Mensajes recientes
Hi Sandip

I am new to Liferay and I have same kind of requirement.

Could you please explain me how to include / write the required conditions in routes.xml

Regards
Syam Kumar
thumbnail
Andrew Jardine, modificado hace 8 años.

RE: How to customize liferay url format

Liferay Legend Mensajes: 2416 Fecha de incorporación: 22/12/10 Mensajes recientes
Hi Syam,

There are a lot of really good examples out there on how to do some of this stuff. For example, Meera has provided a pretty thorough example on his blog: http://www.liferaysavvy.com/2014/06/liferay-friendly-url.html.

You don't actually need to specify all the implicit parameters for p_p_id, or plid etc anymore, just your own paramters that you want to make friendly. If you have a specific example that you need help with, feel free to post it here.