New coral quick action on DAM assets | Community
Skip to main content
Level 2
Oct 10, 2019 5:51 AM UTC
Solved

New coral quick action on DAM assets

Hi everyone,

I have a requirement to add a new quick action on the image cards in the DAM, for example below:

Following this Coral UI guide: Documentation | CoralUI , it gives an example on how to add to add quick action via Javascript

var quickActionsItem = new Coral.QuickActions.Item();

quickActionsItem.icon = 'copy';

quickActionsItem.href = "www.google.com.au";

quickActionsItem.textContent = "Copy asset link";

var target = document.getElementById('coral-id-20');

target.appendChild(quickActionsItem);

Using the guide, I can manually add the 'Copy asset link' item above specifically adding by element ID. However, I'm just wondering if this is the best way to add the new quick action to all image cards in the DAM.  I don't want this new quick action on folders, just the asset card.  So the process that I'd need to do in JS would be:

1. Find all coral-masonry-items

2. Find the hidden div underneath the coral-masonry-item exclude those with data-foundation-container-meta-folder=true

3. Append the new coral quick action to the coral-quickactions

Is there an easier way to achieve a new quick action on DAM assets?

Thank you

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
Theo_Pendle
Theo_PendleAccepted solution
Level 8
Oct 13, 2019 12:52 PM UTC

Hello

Your question inspired me to write a full tutorial on how to add a quick-action by levering OOTB functionalities: https://medium.com/@theopendle/aem-adding-a-touchui-quick-action-to-asset-cards-910b09d499d2 . I used your use-case as a basis so it should answer your question.

Here is the result:

Hope it helps and don't hesitate to get back to me if you have questions/opinions!

2 replies

Level 2
Oct 13, 2019 10:27 PM UTC

Amazing! Thank you   Answers my question perfectly!

Translate
Theo_Pendle
Theo_PendleAccepted solution
Level 8
Oct 13, 2019 12:52 PM UTC

Hello

Your question inspired me to write a full tutorial on how to add a quick-action by levering OOTB functionalities: https://medium.com/@theopendle/aem-adding-a-touchui-quick-action-to-asset-cards-910b09d499d2 . I used your use-case as a basis so it should answer your question.

Here is the result:

Hope it helps and don't hesitate to get back to me if you have questions/opinions!

Translate