cq5 - Adobe CQ Components restricting child components -


i trying create component simple accordion, blocks of content held under headings , 1 heading visible @ time. preferred implementation uses 2 components, 1 represent whole accordion , second component single entry.

the idea content author can pull accordion in sidekick, drop 1 or more accordion items accordion, not allow other components dropped here. accordion items should able dropped accordion component , not within other parsys.

my problem possible add other content accordion , add accordion items outside of accordion.

the first attempt solve was:

foobar/components/accordion foobar/components/accordion/accordion.jsp foobar/components/accordion/cq:editconfig foobar/components/accordion/dialog foobar/components/accordion/accordionitem foobar/components/accordion/accordionitem/accordionitem.jsp foobar/components/accordion/accordionitem/cq:editconfig foobar/components/accordion/accordionitem/dialog 

these config files are:

accordion/.content.xml

<jcr:root xmlns:sling="http://sling.apache.org/jcr/sling/1.0"     xmlns:cq="http://www.day.com/jcr/cq/1.0"     xmlns:jcr="http://www.jcp.org/jcr/1.0"     cq:iscontainer="{boolean}true"     jcr:primarytype="cq:component"     jcr:title="accordion"     sling:resourcesupertype="foundation/components/parbase"     allowedchildren="[*/accordion/accordionitem]"     allowedparents="[*/parsys]"     componentgroup="general"/> 

accordion/_cq_editconfig.xml

<jcr:root xmlns:cq="http://www.day.com/jcr/cq/1.0"     xmlns:jcr="http://www.jcp.org/jcr/1.0"     cq:actions="[-,edit,-,delete]"     cq:layout="editbar"     jcr:primarytype="cq:editconfig">     <cq:listeners         jcr:primarytype="cq:editlistenersconfig"         aftercopy="refresh_page"         afterdelete="refresh_page"         afterinsert="refresh_page"/> </jcr:root> 

the dialog blank , exists component appear in sidekick.

accordion.jsp includes foundation parsys.

accordion/accordionitem/.content.xml

<jcr:root xmlns:sling="http://sling.apache.org/jcr/sling/1.0"     xmlns:cq="http://www.day.com/jcr/cq/1.0"     xmlns:jcr="http://www.jcp.org/jcr/1.0"     jcr:primarytype="cq:component"     jcr:title="accordion item"     sling:resourcesupertype="foundation/components/parbase"     allowedparents="[*/accordion]"     componentgroup="general"/> 

the accordion item dialog takes in title. editconfig adds toolbar, no listeners.

accordionitem.jsp outputs title taken dialog , has parsys.

my problem seems parsys aren't using rules accordion , accordionitem components. instead seem inherit next parsys instead, unless overwritten.

i can set components correctly using edit mode on page , selecting appropriate components, sets information against template, meaning need perform same configuration every page template. want have defined in component definition instead exists once.

after first writing components found blog, describes same scenerio: http://jenikya.com/blog/2012/03/cq5-accordion-component.html

using reference, tried adding extension of parsys use within accordion.jsp instead. made no difference code, custom parsys allowed components other accordion item added.

any guidance on either wrong or other approaches take appreciated.

the solution here use parsys , build composite component restrict accordion content set of components (as described in blog entry).

have @ http://localhost:4502/content/geometrixx/en/company/press/asseteditor.html uses technique dam/components/asseteditor/thumbnail component.


Comments

Popular posts from this blog

blackberry 10 - how to add multiple markers on the google map just by url? -

php - guestbook returning database data to flash -

delphi - Dynamic file type icon -