I have defined two properties on my frontpage-documenttype and on my textpage-documenttype (in the Generics-tab). I have given them the same names on both doc.types: HDUpdate and HDLinks.
I then inserted this on my textpage-template : <umbraco:Item field="HDLinks" recursive="true" runat="server"></umbraco:Item> and thought that it would show the values from the frontpage if the textpage didn't have any value... but no :o(
To the best of my knowledge there's no link between properties of different document types, even if they have the same name. Umbraco wouldn't think to look at a different document type if there was nothing listed on the current one.
I'm guessing the text page is a child of the homepage, if thats the case you can get the text page to look in the homepage's properties by writing an xslt macro containing the following.
<xsl:if test="$currentPage/data [@alias = 'HDUpdate'] !=''> <!--display the property from the text page --> <xsl:value-of select="$currentPage/data [@alias = 'HDUpdate']" /> </xsl:if> <xsl:if test="$currentPage/parent::node/data [@alias = 'HDUpdate'] !="> <!--display the property from the homepage --> <xsl:value-of select="$currentPage/parent::node/data [@alias = 'HDUpdate']" /> </xsl:if>
You'd pop that inside a new xslt file (created in the developer section), when creating the file, tick the box so it creates the macro as well. then include the macro in your text page template.
Recursive property in template dosn't work
I have defined two properties on my frontpage-documenttype and on my textpage-documenttype (in the Generics-tab). I have given them the same names on both doc.types: HDUpdate and HDLinks.
I then inserted this on my textpage-template : <umbraco:Item field="HDLinks" recursive="true" runat="server"></umbraco:Item> and thought that it would show the values from the frontpage if the textpage didn't have any value... but no :o(
Please help me!!
Hi Peter.
To the best of my knowledge there's no link between properties of different document types, even if they have the same name. Umbraco wouldn't think to look at a different document type if there was nothing listed on the current one.
I'm guessing the text page is a child of the homepage, if thats the case you can get the text page to look in the homepage's properties by writing an xslt macro containing the following.
You'd pop that inside a new xslt file (created in the developer section), when creating the file, tick the box so it creates the macro as well. then include the macro in your text page template.
This thread from casey might help as well (http://forum.umbraco.org/yaf_postst2751_XSLT-Tip--Display-a-field-recursively.aspx)
is working on a reply...