How can I get unique ID of asset publisher?

Author: Ajay Choudhary

Liferay Version: 7.0, 7.1, 7.2, 7.3, 7.4

You can use the portlet instance id for referring each asset publisher on the page.

${themeDisplay.getPortletDisplay().getId()}

Now you will be able to get unique ID of asset publisher

<#assign portletID = themeDisplay.getPortletDisplay().getId() />
<#assign splitID = portletID?split("_") />
<#assign assetID = splitID?last />

${assetID}

Here ${assetID} is the Asset publisher ID.

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.

close
Thanks !

Thanks for sharing this, you are awesome !