AnsweredAssumed Answered

How to use evaluator='aspect' to check for (parent) aspect

Question asked by mathias.lin on Dec 27, 2013
Latest reply on Dec 27, 2013 by scouil
I have one aspect which is the parent aspect of two other aspects.


            <aspect name="my:parentAspect">
       </aspect>

       <aspect name="my:subAspect1">
           <parent>my:parentAspect</parent>
           </aspect>

       <aspect name="my:subAspect2">
           <parent>my:parentAspect</parent>
           </aspect>


Now I want to use the "aspect"-evaluator in my share-config-custom to apply some customization if a node directly has the aspect "my:parentAspect" <strong>or if the node has an aspect that has inherited from "my:parentAspect" by having it as a parent</strong>.


<config evaluator="aspect" condition="my:subAspect1">…</config>
<config evaluator="aspect" condition="my:subAspect2">…</config>


works, but I would prefer to use


<config evaluator="aspect" condition="my:parentAspect">…</config>


However, this does not work for nodes that don't have the my:parentAspect attached, i.e. when they have my:subAspect1 attached.

What's the best practice to check for an aspect regardless whether it's directly applied or inherited somewhere down the hierarchy?

Outcomes