There is no OOTB way to dynamically configure editConfig depending on the context, so the easiest solution would be to create a new component that extends the original, which will only cover cq:editConfig node. Thus, you get two variants of the same component: one for parsys, the other for static, but without duplication of code, since the other will be a “minor” override.
Copy the source component to the new one, delete all the files in the new component except .content.xml and _cq_editConfig.xml , in which you need to remove DELETE from cq:actions .
For example, if your source component has resourceType /apps/mysite/myoriginalteaser , then in the new component you should set in .content.xml :
.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" sling:resourceSuperType="mysite/myoriginalteaser"/> ^^^^^^^^^^^^^^^^^^^^^^^
_cq_editConfig.xml: <jcr:root xmlns:cq="http://www.day.com/jcr/cq/1.0" xmlns:jcr="http://www.jcp.org/jcr/1.0" jcr:primaryType="cq:EditConfig" cq:dialogMode="floating" cq:actions="[text:My Fixed Teaser,-,EDIT]" cq:layout="editbar">
NB . If you already have production content with the original resource type, you will need to transfer the resource type for the component with the “new” behavior. This can be done manually (1) manually in CRXDELite, (2) using the Bulk Editor tool, or (3) using the Resource Type Updater from ACS AEM Tools .
source share