add custom attribute in clientlibs generated script tag. | Community
Skip to main content
March 18, 2024
Solved

add custom attribute in clientlibs generated script tag.

  • March 18, 2024
  • 2 replies
  • 779 views

OS: RHEL 7.6
Server: AEM-6.5.1 SP-6.5.20
Dispatcher: (build 4.3.2/apache2.4-linux-x86_64-ssl)

ACS Commons: v4.12.0

 

we are using versioned clientlibs which is working as expected. Now we need to add custom attribute in clientlibs generated script tag as below.

 

<script data-cookieconsent="necessary" src="/etc.clientlibs/myproject/clientlibs/clientlib-base.min.ACSHASH4486893c76fcb85f3930466a411c1975.js"></script>

 

Do we need to customize anything in AEM OOTB or ACS-Commons level add the custom attribute ? Thanks in advance for your replies.

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.

2 replies

arunpatidar
Community Advisor
arunpatidarCommunity AdvisorAccepted solution
Community Advisor
March 18, 2024
somen-sarkar
Community Advisor
Community Advisor
March 18, 2024

Hi @haq81 ,

You can check the following github project to achieve the custom attributes in your script tag

 

.customAttributes - set arbitrary HTML attributes, e.g. customAttributes=['attr1=value 1','data-attr2=5','attr3']

 

Install the extension and try out the same. Hope this will help .

 

Ref :- https://wcm.io/wcm/ui/clientlibs/usage.html

 

Thanks,

Somen