Search code examples
routesliferayliferay-7

Liferay 7.2, how add route to Blogs portlet


I want to add a route to Blogs portlet.

Right now I have: http://localhost:8080/web/guest/home/-/blogs/test

But I want to achieve this: http://localhost:8080/web/guest/notizia/-/news/test

How I can do that?

I tried to do a hook but i don't know how create a hook for routes of if it is the right way.


Solution

  • There are 2 things to do here:

    1. change the path to the page (the part after /web/guest) URL from home to notizia. To do this you need to go to "page configuration" and change the value in "Friendly URL" field. Alternatively you can create another page called notizia and place the blog application there.
    2. change/add friendly URL for the blogs application to take care of /blogs/test part. It will take to too long to explain in details how to do it here but the documentation linked above and this code sample should provide you with enough information how to do it.