Client code for cq:layout=auto | Community
Skip to main content
May 27, 2016
Solved

Client code for cq:layout=auto

  • May 27, 2016
  • 9 replies
  • 2651 views

I would like to use cq:layout="auto" in my component's edit config.  https://docs.adobe.com/docs/en/cq/5-5/developing/components/edit_config.html#cq:layout

The documentation states that auto allows the client code to determine if it should be editbar or rollover, but I can't find any documentation or literature on how to achieve this.  

 

Could anybody provide sample code or links to help?  Thanks!

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 smacdonald2008

I heard back from internal Adobe ppl. They stated: 

I think in that particular context, the “client side code” being referred to is the AEM page editor client-side code, not anything a customer would create. If the component developer specifies “auto” they’re basically telling the page editor to choose whatever layout it wants.

9 replies

smacdonald2008
Level 10
May 27, 2016

You can configure the component’s edit behavior by adding a node of type cq:EditConfig below a given AEM component. You determine the component’s behavior by setting child nodes or properties.

In this case - cq:layout is a prop of  cq:EditConfig -- not a child node. 

See the section "Configuring the Edit Behavior" in this article for information on how to set the cq:EditConfig nodes as part of  CQ component development. 

https://helpx.adobe.com/experience-manager/using/creating-aem-multifield-components.html

Hope this helps... 

smacdonald2008
Level 10
May 27, 2016

I have changed my component by adding a prop (to /apps/nook/components/content/hero/cq:editConfig)  named cq:layout and assigning the value:  editbar.  

Result is -- 

smacdonald2008
Level 10
May 27, 2016

At first - i though you were asking how to set cq:layout. However - now I see what you meant. You want to know how to set client code to use auto for this property. You are correct - there are no details on this. I will investigate. . 

May 27, 2016

Thanks, but I am familiar with setting the cq:layout to editbar.  

My question is specifically about setting the layout to auto.  The documentation describes auto as "The choice is left to the client side code".  I interpret this as meaning that the choice between editbar and rollover is made at page render time, determined by some client code (JSP/JavaScript/something else?).  I am looking for an example or documentation for the "client code" that would dictate which layout to use.

EDIT: you beat me to it.  Sorry, I didn't see your last message until after I submitted.

smacdonald2008
Level 10
May 27, 2016

I have logged a doc bug. You are correct - there is missing information on this subject. The docs need to state how the client code makes that choice and if required - what code needs to be set in the component code. 

May 27, 2016

Thanks Scott.  Do you know what the turn around time is for this type of request?

smacdonald2008
Level 10
May 27, 2016

I have senr email to internal adobe ppl. Waiting to hear back.

smacdonald2008
smacdonald2008Accepted solution
Level 10
May 28, 2016

I heard back from internal Adobe ppl. They stated: 

I think in that particular context, the “client side code” being referred to is the AEM page editor client-side code, not anything a customer would create. If the component developer specifies “auto” they’re basically telling the page editor to choose whatever layout it wants.

May 29, 2016

Thank you, Scott.  That's unfortunate, but it's an answer.