Your achievements

Level 1

0% to

Level 2

Tip /
Sign in

Sign in to Community

to gain points, level up, and earn exciting badges like the new
Bedrock Mission!

Learn more

View all

Sign in to view all badges

cq decoration tag causing problems while moving to touch UI

asn_india
Level 2
Level 2

I am trying to make my pages work in touchUI.Currently they work fine in classic UI.

Each authored label in our case is an instance of either global-text component or global-rte component.

And wherever its value needs to be fetched its done by sling:include above said component.

so in jsp we set a request scope variable with that value.

Further we pass it on to javscript variable like below

<script>

var myLabel=${jspVariable}

</script>

Now when I open page in touchUI - page breaks and there are errors in console which suggest JS is breaking at that assignment mentioned above.

because ${jspVariable} is coming out as 'Chat Now<!--cq{"decorated":false,"type":"myCompany/components/elements/global/global-text","path":"/content/myCompany-com/usa/en/admin/global-labels-framework/jcr:content/pdp-alert-chat-copy",

"selectors":"markup","servlet":"Script /apps/myCompany/components/elements/global/global-text/markup.jsp","totalTime":0,"selfTime":0}-->',

Where as it should actually be 'Chat Now'.

We already have <% slingRequest.setAttribute(ComponentContext.BYPASS_COMPONENT_HANDLING_ON_INCLUDE_ATTRIBUTE, true); %> in place .

PS: Rewriting all the scripts in HTL is not an option because that would mean tremendous amount of rework.

Thanks in advance ..Any pointers will help!!

0 Replies