Copied to clipboard

Flag this post as spam?

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


  • Ravindra 46 posts 117 karma points
    Aug 13, 2014 @ 08:59
    Ravindra
    0

    Rendering page field in another page

    Hiii everybody!

    This is Ravindra!

    I have two pages 1st page doesn't have any page fields but 2nd page has pagefield 'title'.i want to render this title field in 1st page.i have tried many methods like @umbraco.Field("title"),@CurrentPage.title etc in 1st page template but not getting the result....

    please help me to get out of this...

    Thanks and Regards,

    Ravindra

     

     

     

  • Jeavon Leopold 3072 posts 13628 karma points MVP 10x admin c-trib
    Aug 13, 2014 @ 09:04
    Jeavon Leopold
    0

    Hi Ravindra,

    So you need the id of the second page, then in the template of the first page (assuming the id is 1234)

    @Umbraco.Content(1234).title
    

    Jeavon

  • Ravindra 46 posts 117 karma points
    Aug 13, 2014 @ 09:33
    Ravindra
    0

    but i need dynamically...since i will use this  in multi-language site

  • Jeavon Leopold 3072 posts 13628 karma points MVP 10x admin c-trib
    Aug 13, 2014 @ 09:41
    Jeavon Leopold
    0

    Does page two have a different and unique document type to page one?

  • Ravindra 46 posts 117 karma points
    Aug 13, 2014 @ 09:46
    Ravindra
    0

    yes but my case is i have a site in english with two childs and want to build same site withe another language! you know the rest thing

     

  • Jeavon Leopold 3072 posts 13628 karma points MVP 10x admin c-trib
    Aug 13, 2014 @ 10:07
    Jeavon Leopold
    0

    Ok, how about

    @CurrentPage.AncestorOrSelf(1).DocTypeOfSecondPages.First().title
    

    Please note the "s" on the end of "DocTypeOfSecondPage" is in addition to the alias

    Jeavon

  • Ravindra 46 posts 117 karma points
    Aug 13, 2014 @ 11:30
    Ravindra
    0

    Its not working jeavon!

    :(

  • Ravindra 46 posts 117 karma points
    Aug 13, 2014 @ 11:46
    Ravindra
    0

    statically(@Umbraco.Content(1087).title) its working  dynamically not working

  • Jeavon Leopold 3072 posts 13628 karma points MVP 10x admin c-trib
    Aug 13, 2014 @ 12:24
    Jeavon Leopold
    0

    Is your structure like this:

    HomeLang1 (docTypeHome)
    -->Page1 (docTypePage1)
    -->Page2 (docTypePage2)
    HomeLang2(docTypeHome)
    -->Page1 (docTypePage1)
    -->Page2 (docTypePage2)
    

    Then this should work

    @CurrentPage.AncestorOrSelf(1).docTypePage2s.First().title
    
  • Ravindra 46 posts 117 karma points
    Aug 13, 2014 @ 12:35
    Ravindra
    0

    where page2 is name of the the child page?

    i tried with chilpage name but no result jeavon!

  • Jeavon Leopold 3072 posts 13628 karma points MVP 10x admin c-trib
    Aug 13, 2014 @ 12:39
    Jeavon Leopold
    100

    It's the document type alias that's important here. In my tree "Page2" is the name and "docTypePage2" is the alias of the document type that "Page2" is using.

  • Ravindra 46 posts 117 karma points
    Aug 13, 2014 @ 12:47
    Ravindra
    0

    exactly jeavon there i missing out very very thankful to you man

     

    Regards ,

    Ravindra!

     

  • Jeavon Leopold 3072 posts 13628 karma points MVP 10x admin c-trib
    Aug 13, 2014 @ 13:07
    Jeavon Leopold
    0

    You're welcome

Please Sign in or register to post replies

Write your reply to:

Draft