Copied to clipboard

Flag this post as spam?

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


  • Aditya.A 77 posts 96 karma points
    Nov 05, 2013 @ 06:53
    Aditya.A
    0

    calling content from contols

    Hello all,

     

    I have a contact page that has textbox to hold the address.Now i want to display the same text in another 

    page.How can i call the data in that control to another page.

     

    Regards

  • Jeavon Leopold 3074 posts 13632 karma points MVP 11x admin c-trib
    Nov 05, 2013 @ 09:57
    Jeavon Leopold
    0

    Hi Aditya,

    Are you using MVC? Assuming you are, you will need to use a SurfaceController and the UmbracoBeginForm and then save your data to a property using the Content Service (or a custom table).

    So useful links for you

    Hope that's helpful

    Jeavon

  • Aditya.A 77 posts 96 karma points
    Nov 05, 2013 @ 13:06
    Aditya.A
    0

    Hello Jeavon Leopold,

     

    Thank you for you answer and sorry for not metioning the q' completely.

    Actuallly i am not using MVC. As new begginer to umbraco i have used the starter kit to create sample site and added 

    a textbox fied to the documet type(inner page). Now i want to display the text in the inner page on to the hompeage (anothr template)

    I hope you understand.

     

    Thanks

  • Jeavon Leopold 3074 posts 13632 karma points MVP 11x admin c-trib
    Nov 05, 2013 @ 13:54
    Jeavon Leopold
    1

    Ok, so I think you have a tree structure like this?

    Home
      -> InnerPage
      -> More Pages
    

    And you would like to display some content you have added as a TextBox to InnerPage on the Homepage?

    Have you created a MacroScript and added the Macro to your MasterPage template?

    Once you have done this, then something like this should work (substitute 1234 for your InnerPage id and "address" for the alias of your TextBox property)

    @{
    var innerNode = Library.NodeById(1234);
    }
    <p>
      @innerNode.address
    </p>
    
  • Aditya.A 77 posts 96 karma points
    Nov 11, 2013 @ 12:49
    Aditya.A
    0

    Hello Jeavon Leopold,

    Sorry i am unable to reply you ...

    Yes that is quite useful if i am having a single siteroot.

    But if i am using a multilingual site like below and i have to show the contact info how can i achieve ??

    Because i here the pageid will not hold ,so i have to refer from the contol itself

     

    Siteroot eng

     --- Homepage

      ---Contact

    Siteroot dede

      ---Hompage

      ---COntact

  • Jeavon Leopold 3074 posts 13632 karma points MVP 11x admin c-trib
    Nov 11, 2013 @ 22:57
    Jeavon Leopold
    0

    Something like this (replace AliasOfContactPage with the document type alias of your contact page):

    var contactPage = Model.Children.Where("NodeTypeAlias == @0", "AliasOfContactPage").FirstOrDefault();
    if (contactPage != null)
    {
        <p>@contactPage.address</p>
    }
    
Please Sign in or register to post replies

Write your reply to:

Draft