Copied to clipboard

Flag this post as spam?

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


  • Vinni 11 posts 31 karma points
    Jul 19, 2013 @ 14:22
    Vinni
    0

    how to access property of one page into another

    hii

    i have a master page whose doc type is master and template allowed is home , a home page have doc type and template is home.

    now i want to access the properties of home doc type on master with razor.plz help

  • Fuji Kusaka 2203 posts 4220 karma points
    Jul 19, 2013 @ 14:29
    Fuji Kusaka
    0

    Hi,

    If you are using Razor in your Template try this

    @{
        @Model.propertyAlias
    }

    However can you tell us more about what you are trying to do.

  • Vinni 11 posts 31 karma points
    Jul 19, 2013 @ 14:37
    Vinni
    0

     the code for Slider that i want to access in master,which is for home page property imageSlider

    i want to use this property in master

    @inherits umbraco.MacroEngines.DynamicNodeContext

     

    @{

    if (Model.HasValue("imageSlider"))

    {

    var slider = Library.NodeById(Model.imageSlider);

     

    foreach (var item in @slider.Children)

    {

    if(@item.Position() == 0)

    {

    <div class="active item">

    <a href="@item.link1">

    <img src='@item.Media("image1", "umbracoFile")' style="width:828; height:379;" alt="" />

    </a>

    </div>

    }

    else

    {

    <div class="item">

    <a href="@item.link">

     <img src='@item.Media("image1", "umbracoFile")' style="width:828; height:379;" alt="" />

    </a>

    </div>

    }

    }

     

    }

     

    }

Please Sign in or register to post replies

Write your reply to:

Draft