Sample code in JSP
you can set the label value of the component edit bar dynamically.
editContext is implicit object of com.day.cq.wcm.api.components.EditContext interface
editContext.getEditConfig().getToolbar().add(0, new Toolbar.Label("sample"));
By Using cq:EditConfig
Add the below configurations under your component's "cq:EditConfig" node
<cq:actionConfigs jcr:primaryType="nt:unstructured">
<separator
jcr:primaryType="nt:unstructured"
xtype="tbseparator"/>
<manage
jcr:primaryType="nt:unstructured"
handler="function(){
	window.open(CQ.WCM.getPagePath()+".openNewPage.html", '_blank');
}"
text="Edit on Other Page"/>
</cq:actionConfigs>
you can set the label value of the component edit bar dynamically.
editContext is implicit object of com.day.cq.wcm.api.components.EditContext interface
editContext.getEditConfig().getToolbar().add(0, new Toolbar.Label("sample"));
By Using cq:EditConfig
Add the below configurations under your component's "cq:EditConfig" node
<cq:actionConfigs jcr:primaryType="nt:unstructured">
<separator
jcr:primaryType="nt:unstructured"
xtype="tbseparator"/>
<manage
jcr:primaryType="nt:unstructured"
handler="function(){
	window.open(CQ.WCM.getPagePath()+".openNewPage.html", '_blank');
}"
text="Edit on Other Page"/>
</cq:actionConfigs>
No comments:
Post a Comment
If you have any doubts or questions, please let us know.