SIghtly ClientContext conflict on custom components | Community
Skip to main content
New Participant
February 19, 2016
Solved

SIghtly ClientContext conflict on custom components

  • February 19, 2016
  • 5 replies
  • 2750 views

Hello,

When client context is included on a page with baked in custom components, those components are no longer available to edit in author mode.  I see the standard cq-placeholder for the component but when mousing over the component it is not highlighted and the edit options do not display.  The parsys components and OOTB AEM components work fine.

 

//included in body.html <sly data-sly-resource="${ @path='clientcontext', resourceType='cq/personalization/components/clientcontext'}"  /> //included in content.html on our template <div data-sly-resource="${'./text' @ resourceType='project/components/content/text'}"></div> <section data-sly-resource="${'./mainParsys' @ resourceType='foundation/components/parsys'}"></section>
This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
Best answer by Amit_Kumar

bfvaughn wrote...

Hello,

When client context is included on a page with baked in custom components, those components are no longer available to edit in author mode.  I see the standard cq-placeholder for the component but when mousing over the component it is not highlighted and the edit options do not display.  The parsys components and OOTB AEM components work fine.

 

  1. //included in body.html
  2. <sly data-sly-resource="${ @path='clientcontext', resourceType='cq/personalization/components/clientcontext'}" />
  3.  
  4. //included in content.html on our template
  5. <div data-sly-resource="${'./text' @ resourceType='project/components/content/text'}"></div>
  6. <section data-sly-resource="${'./mainParsys' @ resourceType='foundation/components/parsys'}"></section>

 

 

 

It seems like a path conflict to me, can you change <sly data-sly-resource="${ @path='clientcontext', resourceType='cq/personalization/components/clientcontext'}" /> to  <div data-sly-resource="${ @path='clientcontext-new', resourceType='/libs/cq/personalization/components/clientcontext'}" data-sly-unwrap></div> 

5 replies

New Participant
May 14, 2019

For us it even worked if we change "sly" tag to "div" tag like below

<div data-sly-resource="${'clientcontext' @ resourceType='cq/personalization/components/clientcontext'}"></div>

bfvaughnAuthor
New Participant
February 19, 2016

No joy.  It is just weird that the mouse over actions work for the parsys but not the custom components.  There must be some conflict in the javascript causing the mouse over events to not trigger.

Amit_Kumar
Amit_KumarAccepted solution
New Participant
February 19, 2016

bfvaughn wrote...

Hello,

When client context is included on a page with baked in custom components, those components are no longer available to edit in author mode.  I see the standard cq-placeholder for the component but when mousing over the component it is not highlighted and the edit options do not display.  The parsys components and OOTB AEM components work fine.

 

  1. //included in body.html
  2. <sly data-sly-resource="${ @path='clientcontext', resourceType='cq/personalization/components/clientcontext'}" />
  3.  
  4. //included in content.html on our template
  5. <div data-sly-resource="${'./text' @ resourceType='project/components/content/text'}"></div>
  6. <section data-sly-resource="${'./mainParsys' @ resourceType='foundation/components/parsys'}"></section>

 

 

 

It seems like a path conflict to me, can you change <sly data-sly-resource="${ @path='clientcontext', resourceType='cq/personalization/components/clientcontext'}" /> to  <div data-sly-resource="${ @path='clientcontext-new', resourceType='/libs/cq/personalization/components/clientcontext'}" data-sly-unwrap></div> 

bfvaughnAuthor
New Participant
February 19, 2016

Same issue.  In touch UI the components are not editable.  

Lokesh_Shivalingaiah
New Participant
February 19, 2016

Can you try with 

<div data-sly-resource="${'clientcontext' @ resourceType='cq/personalization/components/clientcontext'}" data-sly-unwrap></div>