For Liferay DXP 7.0 administration applications, the title should be moved to the inner views of the app and the associated back link should be moved to the portlet titles.
If you open the Blogs Admin application in the Control Panel and add a new blog entry, you’ll see this behavior in action:
This tutorial uses the Blogs Admin application’s
as an example.
Follow these steps to configure your app’s title and back URL:
ParamUtilto retrieve the redirect for the URL:
String redirect = ParamUtil.getString(request, "redirect");
Display the back icon and set the back URL to the
Finally, set the title using the
renderResponse.setTitle()method, as shown in the example configuration below:
renderResponse.setTitle((entry != null) ? entry.getTitle() : LanguageUtil.get(request, "new-blog-entry")); %>
The example above provides a title for two scenarios:
- If an existing blog entry is being updated, the blog’s title is displayed.
- Otherwise it defaults to New Blog Entry since a new blog entry is being created.
You should also update any back links in the view to use the
edit_entry.jsp form’s cancel button redirects the user:
<aui:button cssClass="btn-lg" href="<%= redirect %>" name="cancelButton" type="cancel" />
Now you know how to configure your app’s title and back URL!