Copied to clipboard

Flag this post as spam?

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


  • Zack 12 posts 112 karma points
    Sep 21, 2015 @ 08:37
    Zack
    0

    Umbraco true/false with master page template

    I am the true/false property in umbraco i'm trying to set a placeholder to be visible or hidden depending on what I set it in the backoffice

    Currently i tried to use

    <asp:PlaceHolder runat="server" Visible="<umbraco:item field="hotVisible1" runat="server"/>" >
    

    but keep getting a parser Error if any one knows how to get the effect i'm after I'm all ears, Thanks in advance.

  • Alex Skrypnyk 6150 posts 24110 karma points MVP 8x admin c-trib
    Sep 21, 2015 @ 10:06
    Alex Skrypnyk
    0

    Hi Zack,

    Try to use c# code for that:

    placeHolderId.Visible = CurrentPage.hotVisible1;
    

    Thanks, Alex

  • Zack 12 posts 112 karma points
    Sep 21, 2015 @ 14:37
    Zack
    0

    Thanks but when using Webforms CurrentPage does not exist unless i'm missing a reference. or inheritance.

  • Alex Skrypnyk 6150 posts 24110 karma points MVP 8x admin c-trib
    Sep 21, 2015 @ 15:17
    Alex Skrypnyk
    100

    Zakc, try to use Node:

    Node src = Node.GetCurrent();
    
  • Zack 12 posts 112 karma points
    Sep 21, 2015 @ 15:37
    Zack
    0

    That worked

    this.lihot1.Visible = Convert.ToBoolean(Convert.ToInt32(umbraco.NodeFactory.Node.GetCurrent().GetProperty("hotVisible1").Value));
    

    thanks for the help

  • Alex Skrypnyk 6150 posts 24110 karma points MVP 8x admin c-trib
    Sep 21, 2015 @ 15:50
    Alex Skrypnyk
    0

    Great ) You are welcome!

Please Sign in or register to post replies

Write your reply to:

Draft