Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Geoff Stokes 19 posts 38 karma points
    Aug 08, 2011 @ 07:53
    Geoff Stokes
    0

    Global Editable Content

    Hi,

     

    I'm trying to create an editable piece of content which will be visible on all pages using a particular template. The content should be editable by an end-user (Who doesn't have access to the developer sections) and should not have to be configured on every single page.

     

    Similarly, is it possible to have a property set on a parent page cascade to child pages, or, alternatively, set a default for a property?

     

    Thanks.

  • Peter Gregory 408 posts 1614 karma points MVP 3x admin c-trib
    Aug 08, 2011 @ 08:05
    Peter Gregory
    0

    Hey Geoff

    I understand what you are trying to do now :)

    So what you want to do is create those global properties on say the Homepage node of you site.  When you add those properties onto you template make sure you make the property Recursive.

    What this does is tells umbraco to read back up the tree until it finds a value for the property.

    <umbraco:item field="yourPropertyAlias" recursive="true" runat="server" />

    I hope that this makes sense and is what you are after.

    Thanks

    Peter Gregory

  • Geoff Stokes 19 posts 38 karma points
    Aug 09, 2011 @ 11:26
    Geoff Stokes
    0

    Hi Peter,

    The recursive attribute does not work with xsl:variable items. Is there an equivalent that can be used within xslt?

    And I didn't realise until now that the solution to both these problems can be the same thing. Haha :)

    Thanks,

    Geoff

  • Peter Gregory 408 posts 1614 karma points MVP 3x admin c-trib
    Aug 12, 2011 @ 04:21
    Peter Gregory
    0

    In XSLT you can approach recursion this way.

    <xsl:value-of select="$currentPage/ancestor-or-self::* [string(yourField)!=''] [1] yourField" />

    Hope thats what you were looking for?

    Peter

  • Geoff Stokes 19 posts 38 karma points
    Aug 12, 2011 @ 04:29
    Geoff Stokes
    0

    So if my current code is:

    <xsl:variable name="images" select="$currentPage/albumFolder"/>

    How would I integrate that?

    <xsl:variable name="images"><xsl:value-ofselect="$currentPage/ancestor-or-self::* [string(albumFolder)!=''] [1] albumFolder"/></xsl:variable>
    Or something different?
  • Geoff Stokes 19 posts 38 karma points
    Aug 12, 2011 @ 04:32
    Geoff Stokes
    0

    Actually, considering the object I'm trying to retrieve is a "Media Picker" I probably have to change it from string(albumFolder), correct?

Please Sign in or register to post replies

Write your reply to:

Draft