I wonder why would you want this.
Anyways, I think you can change the urlTitle
field of BlogsEntry
and append .html
to the string. May be use a service-wrapper-hook to append .html
to the urlTitle
whenever a blog is created or updated.
Or you can even use a ModelListener
if it exists for BlogsEntry hook to update the blog's urlTitle
by using onCreate
& onUpdate
methods.
Edit
The urlTitle
field is present in the BlogsEntry
table.
You can access this in java with the following methods:
BlogsEntry blog = BlogsEntryLocalServiceUtil.getBlogsEntry(90989); // retrieves the blog-entry
String blogUrlTitle = blog.getUrlTitle();
blog.setUrlTitle(blogUrlTitle + ".html"); // this would set the string
You can have a check for the blogUrlTitle
so that you don't have repeated .html
appended to the string:
if (!blogUrlTitle.contains(".html")) { // append only if the title does not contain `.html`
blog.setUrlTitle(blogUrlTitle + ".html");
}
You can refine your code as you like, the above is just a guide-line.
As a side-note, I would always try to reason with the client why they want something, this helps not only to fend-off bad-change-requests but also helps in giving an alternative to the client (which is less taxing on the developers like us ;-) ). In most cases this helps to understand the client's business better & provide better returns.