Copied to clipboard

Flag this post as spam?

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


  • Biagio Paruolo 1618 posts 1910 karma points c-trib
    Oct 11, 2010 @ 10:17
    Biagio Paruolo
    0

    Global Field for a site..

    Hi,

    I've read this post ( http://our.umbraco.org/forum/using/ui-questions/6984-Global-page-fields ), but if I want create a particular node ( say Config_Site  with setup fields ), How Can I refer that fields from other web site pages?

    For Example: into Master Page we have footer field, logo field and so, but If I go in a child field , I don't see their content.

    Thank you

  • Rich Green 2246 posts 4008 karma points
    Oct 11, 2010 @ 10:32
    Rich Green
    0

    Hi,

    You can do this in (at least) two different ways.

    Let's say that you want to access a field named "CompanyName" which you want to use anywhere,  you can create either:

    Create a property on your home node named "CompanyName" and then in your templates/macros use 'recursion' to access this fields value, this will basically looks up the content tree until it finds a field named "CompanyName" which is not empty.

    The other way is to grab the value directly, this is for when you've set up a node outside of your website, for example "Config_Site", you can grab this in XSLT via a variety of ways, one being using the ID of the node, see example here http://our.umbraco.org/wiki/reference/umbracolibrary/getxmlnodebyid

    The other way is to grab the value using it's DocType, to do this you need to grab the Root of the site and look down the content tree for the specific Doc Type, you don't mention which version of Umbraco you are using so I can't offer a specific example for this.

    Hope that makes sense and gives you some ideas.

    Cheers

    Rich

     

     

  • Biagio Paruolo 1618 posts 1910 karma points c-trib
    Oct 11, 2010 @ 12:16
    Biagio Paruolo
    0

    Thanks for your reply. Version is 4.5.2

    Is it possible by Name ( GetXmlNodeById not by ID , because I'm on devel machine, now )?

Please Sign in or register to post replies

Write your reply to:

Draft