How to add custom attribute to cq:text ?


hi,

 

currently using <cq:text property="text"/> display text in page.

i need find way add custom attribute text compnent (highlighted in example below).

 

eg.

====================================

<div id="cq-gen23" class="text section cq-element-parpanel_47text">

<p id="cq-gen35" customattributehere="true">testing test test<br></p>
<script id="cq-gen36" type="text/javascript">

</div>

====================================

 

is there way can above?

here couple methods:

 

method 1:

add attribute while author in edit mode. implement own text component , configure dialog use event listener adds attribute each paragraph tag in component. listen "valid" event fires when author clicks ok button in widget. method added attribute stored in jcr. see documentation: http://dev.day.com/docs/en/cq/current/developing/widgets.html

 

method 2:

write javascript adds attribute each paragraph in component when page loaded. method attribute not stored in jcr. trivial jquery.



More discussions in Archived Spaces


adobe

Comments

Popular posts from this blog

How to set the order of FAQs instead of alphabetical

Thread: Get UK Keyboard working

how do I change the e-mail address for my merchant account