Legacy Knowledge Base
Published Jul. 2, 2025

How to customize the presentation layer for Alerts and Announcements widgets?

Written By

Alfonso Crisci

How To articles are not official guidelines or officially supported documentation. They are community-contributed content and may not always reflect the latest updates to Liferay DXP. We welcome your feedback to improve How To articles!

While we make every effort to ensure this Knowledge Base is accurate, it may not always reflect the most recent updates or official guidelines.We appreciate your understanding and encourage you to reach out with any feedback or concerns.

Legacy Article

You are viewing an article from our legacy "FastTrack" publication program, made available for informational purposes. Articles in this program were published without a requirement for independent editing or verification and are provided"as is" without guarantee.

Before using any information from this article, independently verify its suitability for your situation and project.

Issue

  • How to customize the presentation layer for Alerts and Announcements widgets?

Environment

  • Liferay DXP 7.0+

Resolution

  • Behind the scenes, both widgets use the same presentation layer and this, rather than being an FTL template, it is a plain jsp. In 7.1 DXP, for example:

    liferay-dxp-7.1.10-ga1/osgi/marketplace/Liferay Collaboration - Liferay Announcements - Impl.lpkg\com.liferay.announcements.web-3.0.25.jar//META-INF/resources/announcements/view.jsp

    This file is shared among both widgets but contains the logic for differentiating the two, for example, see row #42:
    <aui:button href="<%= addEntryURL %>" icon="icon-plus" value='<%= portletName.equals(AnnouncementsPortletKeys.ALERTS) ? "add-alert" : "add-announcement" %>' />
    The simplest approach to overriding the file is through a JSP Fragment: JSP Overrides Using OSGi Fragments.

    For the sake of testing, a tiny module was created, tested and attached to this article. The module adds a <h1> element.
Did this article resolve your issue ?

Legacy Knowledge Base