Expand my Community achievements bar.

Don’t miss the AEM Skill Exchange in SF on Nov 14—hear from industry leaders, learn best practices, and enhance your AEM strategy with practical tips.
SOLVED

Client code for cq:layout=auto

Avatar

Former Community Member

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!

1 Accepted Solution

Avatar

Correct answer by
Level 10

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.

View solution in original post

9 Replies

Avatar

Level 10

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... 

Avatar

Level 10

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 -- 

Avatar

Level 10

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. . 

Avatar

Former Community Member

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.

Avatar

Level 10

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. 

Avatar

Former Community Member

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

Avatar

Level 10

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

Avatar

Correct answer by
Level 10

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.

Avatar

Former Community Member

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