Copied to clipboard

Flag this post as spam?

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


  • Peter Schermers 112 posts 134 karma points
    Aug 23, 2012 @ 12:17
    Peter Schermers
    0

    Page field from other template

    Okay, so I build a website that exists of just one looooooooong htmlpage, divided into several page sections ('Home', 'News', 'Contact', etc). This means I have all my page sections floated under each other, and a fixed navbar.

    In Umbraco I wanted to keep the usability of this site as high as possible, thus I decided to create an Umbraco page for each page section. Clearly I just needed to create ONE template since it's just one long page.

    I connected this template to my 'Home' page in Umbraco, and everything worked fine. But then I started creating page fields on the OTHER pages as well, and put them also into this template. But while filled in, these page fields return empty in the template! Only the page fields of 'Home' are perfectly working, just not any page from outside.

    I even tried connecting the other pages ('News', 'Contact', etc) to the same template, but this also doesn't work.

    What am I doing wrong?

  • Fuji Kusaka 2203 posts 4220 karma points
    Aug 23, 2012 @ 12:38
    Fuji Kusaka
    0

    Hi Peter,

    Am not sure how you structured your Content Section but from what i read your document Type might not be associated to your Template.

    What you could do is create a "Master Template" under which you will have all your html and then from there create a doctype with a matching Template for "Homepage" and same for the other "Inner Pages".

    In your "Homepage and InnerPages" template make sure to associtate them to the "Master Template" from the Drop down menu. 

    This should get you working again.

    //fuji

     

  • Peter Schermers 112 posts 134 karma points
    Aug 23, 2012 @ 13:24
    Peter Schermers
    0

    Hi Fuji,

     

    Thanks for your quick reply! Let me show you how I organised things in Umbraco:

    TEMPLATES:

    +Home

    DOCTYPES:

    +Home (template: Home)
    +News (template: Home)
    +Contact (template: Home)

    In this template is ALL of my HTML, since it's just ONE LONG HTML page. There's nothing more than that.
    When I create page fields in doctype Home, it's all working. But when I create a page field in News and refer to it inside template 'Home', this page field (however filled in) stays empty! 

    So I guess your solution won't help me either... :-( 

  • Peter Schermers 112 posts 134 karma points
    Aug 23, 2012 @ 13:27
    Peter Schermers
    0

    Oh wait, I suddenly think I understand what you're saying:

    I need to break the long html page into several pieces and - using a master template - put them together in their own templates!

     

    Right?

  • Fuji Kusaka 2203 posts 4220 karma points
    Aug 23, 2012 @ 13:39
    Fuji Kusaka
    0

    Hi again Peter,

    Well if you have a website where only some part of the content will change where the look and feel is somehow the same you can do something like i posted earlier.

    Remember to make use of the Content Placeholder in the MasterTemplate where those content will be different and call those Placeholders in the Template you would like to display those infos.

    Hope it make sense.

    //fuji 

  • Fuji Kusaka 2203 posts 4220 karma points
    Aug 23, 2012 @ 13:43
    Fuji Kusaka
    0

    Just to Illustrate your Template Folder 

    - MasterTemplate
    -- Home
    -- Inner
    -- News
    -- Contact
    - Content
    -- Home
    --- Page 1
    --- Page 2
    --- Page 3 (Contact)
    --- Page 4 (News)
    ---- News 1
    ---- News 2 

     

  • Peter Schermers 112 posts 134 karma points
    Aug 23, 2012 @ 14:17
    Peter Schermers
    0

    Okay, I drew it - this should make it all clearer:

     

     

    Is this possible? If yes, how? Since you never actually are getting onto those Umbraco 'pages', does that mean their content will never be shown?

  • Peter Schermers 112 posts 134 karma points
    Aug 23, 2012 @ 14:18
    Peter Schermers
    0

    Wow, Umbraco never heard of scaling images, I guess xD

  • Peter Schermers 112 posts 134 karma points
    Aug 23, 2012 @ 16:00
    Peter Schermers
    0

    Never mind, I finally got it solved using Razor!

    Thanks anyway, Fuji! ;-)

  • Fuji Kusaka 2203 posts 4220 karma points
    Aug 23, 2012 @ 16:05
    Fuji Kusaka
    0

    Great if you got it working though...

Please Sign in or register to post replies

Write your reply to:

Draft