cancel
Showing results for 
Search instead for 
Did you mean: 

property inheritance in types

robertmarkbram
Champ in-the-making
Champ in-the-making
Hi All,

Going through Jeff Potts' SomeCo example from his Developer Guide, I have created (among others) these two types:

<type name="sc:marketingDoc">
   <title>Someco Marketing Document</title>
   <parent>sc:doc</parent>
   <properties>
      <property name="sc:campaign">
         <type>d:text</type>
         <multiple>true</multiple>
         <constraints>
            <constraint ref="sc:campaignList" />
         </constraints>
      </property>
   </properties>
</type>
<type name="sc:whitepaper">
   <title>Someco Whitepaper</title>
   <parent>sc:marketingDoc</parent>
</type>

And in my config-custom.xml file, a rule says display campain for marketingDocs:

<config evaluator="node-type" condition="sc:marketingDoc">
   <property-sheet>
      <show-property name="sc:campaign" display-label-id="campaign" />
   </property-sheet>
</config>


So…  a marketingDoc has a campaign property (list) and a whitepaper is a marketingDoc. Why then, when I create a whitepaper, don't I see campaign? I thought there was inheritance in effect here?

Thanks for any advice!

Rob
Smiley Happy
3 REPLIES 3

almer_bolatov
Champ in-the-making
Champ in-the-making
Hi, have you found an answer?

thanks,

robertmarkbram
Champ in-the-making
Champ in-the-making
Haven't tested this yet, but this is what I think. Inheritance doesn't include the visibility of properties, so you still need to declare those properties visible in the property sheet.


<config evaluator="node-type" condition="sc:whitepaper">
   <property-sheet>
      <show-property name="sc:campaign" display-label-id="campaign" />
   </property-sheet>
</config>

almer_bolatov
Champ in-the-making
Champ in-the-making
I might be mistaken but it should inherit properties from its ancestor.
I had this example work, but it doesn't know, I don't know why.