Copied to clipboard

Flag this post as spam?

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


  • Al Gilson 7 posts 27 karma points
    Jan 03, 2011 @ 20:43
    Al Gilson
    0

    Accessing fields from another doc type

    Here's the set up. I have an Umbraco 4.5.2 install. I have created a Document Type called "ClientBase" and I have created another Document Type called "general". The ClientBase document type has multiple entries textstring boxes on a tab called ClientInfo. The idea is that I can make a tab that is easily copied and yet can have personal information for a client on it. I.e: client name, client address, client city, etc.

    I have created another Document Type called "general", which then has a child Document Type called "Accelerate".

    In the content section, I have created content called "Accelerate", which is the client name, it is Document Type "ClientBase", and I have all of the textstring boxes available above that I'm looking for. I.e. clientName, clientAddress, clientCity, etc. I have a created my Index, etc. using the "Accelerate" Document Type. The idea is that I don't want the tab with "ClientBase" information visible with all the tab information that is setup on the "Accelerate" tab. (Lost you yet?)

    Ultimately I want to be able to set up all the client information on the root of the site, and then have it propogate to all the child pages without having the tab show up again.

    So, the problem: all of the information available on ClientBase is easily accessible via:

    <umbraco:Item field="clientName" Recursive="true" runat="server">

    but all of the information available from the other document type "general" doesn't seem to be available. I.e. if i use:

    <umbraco:Item field="mainHeader" Recursive="true" runat="server">

    It's blank. Now I understand that mainHeader is from another Document Type when I'm using the "ClientBase" doc type. Is there a way to do this? Have I used the correct terminology? Help?


    - Al

     

  • Rich Green 2246 posts 4008 karma points
    Jan 03, 2011 @ 21:21
    Rich Green
    0

    Hey Al,

    I did get lost along the way there, maybe post an image of your content structure?

    To answer your question (I hope) Doc types don't have relevance to whether data is accessible, just if the fields are.

    For instance:

    Home (doc type)

    - ClientBase1 (doc type)

    - General1 (doc type)

    If all 3 of these doc types had a property of "ClientName" then this field would be available at any level within the site using the recursive value.

    Maybe open up a file named "umbraco.config" in your App_Data folder, this holds all your published data and you can see here what data is available.

    Rich

     

  • Al Gilson 7 posts 27 karma points
    Jan 04, 2011 @ 15:49
    Al Gilson
    0

    Thanks for replying Rich. Turns out that I just needed to walk away from the project and it now works. Something, somewhere, must have been cached. Oh well, there goes a 5 hours that I can't get back. I haven't looked yet, but is there an easy way to refresh the cache?

    - Al

     

  • Rich Green 2246 posts 4008 karma points
    Jan 04, 2011 @ 15:53
    Rich Green
    0

    Hey Al,

    Glad you got it sorted!

    Publishing a node should refresh the cache, or you can right click the content node and select "Republish entire site", should normally be ok though so maybe something went wrong along the way.

    Let us know if it happens again.

    Rich

     

     

Please Sign in or register to post replies

Write your reply to:

Draft