Issue
-
Within the drop-down menu for Web Content, is there a way to configure my own custom items?
-
The example for Document Library seen in this blog utilizes the DLDisplayContextFactory extension point. Is there an equivalent for Web Content?
Environment
- DXP 7.3
Resolution
-
There is no equivalent extension point like DLDisplayContextFactory for Web Content. Presently this is a recognized product limitation.
-
However, the intended need is theoretically possible by instead directly modifying Liferay source code for JournalArticleActionDropdownItemsProvider, which is functionally equivalent to developing a marketplace override.
For reference, changes could be modeled using this commit. To get a functioning custom item, JournalDisplayContext and JournalArticleActionDropdownItemsProvider are utilized. We can check this by looking at our view_entries.jsp where we use the following to call a Clay implementation of a dropdown menu:
<liferay-ui:search-container-column-text>
<clay:dropdown-actions
defaultEventHandler="<%= JournalWebConstants.JOURNAL_ELEMENTS_DEFAULT_EVENT_HANDLER %>"
dropdownItems="<%= journalDisplayContext.getArticleActionDropdownItems(curArticle) %>"
/>
</liferay-ui:search-container-column-text>The list is populated using getArticleActionDropdownItems which is populated by the DropdownItemsProvider.
JournalArticleActionDropdownItemsProvider is the location where the item is added to the dropdown menu and can be used to further trace from there.
See:
- com.liferay.frontend.taglib.clay.servlet.taglib.util.DropdownItem
- com.liferay.frontend.taglib.clay.servlet.taglib.util.DropdownItemList;
- com.liferay.frontend.taglib.clay.servlet.taglib.util.DropdownItemListBuilder;
- com.liferay.journal.web.internal.servlet.taglib.util.JournalArticleActionDropdownItemsProvider
- modules\apps\journal\journal-web\src\main\resources\META-INF\resources\view_entries.jsp
- ElementsDefaultEventHandler
Note: For clarification, marketplace overrides do not leverage documented extension points. Marketplace overrides, forcefully override Liferay behavior in order to achieve a given need.
Additional Information
- A feature request for this functionality for Web Content has been raised. It may be followed here.