RE: How to change Display Template Page url for Blog posts?

Adam Fuiba, modified 6 Years ago. Junior Member Posts: 34 Join Date: 4/17/13 Recent Posts
I'm using the Blogs portlet to list all blog posts in a page localhost:8080/web/guest/blog and I use the Display Template Page for blog details.
​​​​​​​The problem is that when I open a post the URL changes to: http://localhost:8080/web/guest/b/blog-post-example
The friendly url for Blog is changed from:
http://localhost:8080/web/guest/blog/
to
http://localhost:8080/web/guest/b/

Is there a way to avoid changing the parent page url?
Johanna Tchon, modified 6 Years ago. New Member Post: 1 Join Date: 2/12/20 Recent Posts
If you want to change the friendly url for blogs, you should create a new InfoDisplayContributor, you can copy BlogsEntryInfoDisplayContributor and then change the
public String getInfoURLSeparator() 
Currently it return "/b/".
Jamie Sammons, modified 2 Years ago. New Member Post: 1 Join Date: 6/26/22 Recent Posts

Hi Johanna,

We are facing issue while rendering the blogs content.

We are using Liferay DXP 7.4 OOTB Blogs functionality. As we are using Display page template for blogs details page the URL being formed is :
https://www.xxx.in/b/blog-title

We were able to override the URL from /b to /blogs through overridden of below constant class value,

https://github.com/Liferay/liferay-portal/blob/master/portal-kernel/src/com/liferay/portal/kernel/portlet/constants/FriendlyURLResolverConstants.java

Problem:
The issue is occurring when we click on read more option or results from the global search the page being redirected to the "
https://www.xxx.in/blogs/blog-title" page, but the blogs content are not rendering and it's throwing error. The blogs content still available only in /b URL.

Could you please help us on this issue to resolve it ASAP ?