Copied to clipboard

Flag this post as spam?

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


  • Chaitanya Gadkari 27 posts 66 karma points
    May 11, 2015 @ 13:27
    Chaitanya Gadkari
    0

    Model.Content.ShowToVisitor() is always true regardless of the criteria

    Hi,

    I am using this package with Umbraco(v7.2.1) and with Standard Website MVC(v2.0) Package. I have added personalisation group picker to Content Master document type so that this property can be set to all pages. Now I have added different Personalisation Group to different pages and edited the tempate Standard Page as below to check criteria before displaying page.

    @if(Model.Content.ShowToVisitor())

    {

     <div id="mainContent" class="fc">

     

          <div class="navigation">

            @Html.Partial("LeftNavigation",@Model.Content)

          &nbsp;

          </div>

     

           <div id="content">

                @Html.Raw(Model.Content.GetPropertyValue<string>("bodyText"))

           </div>

     

            @Html.Partial("ContentPanels",@Model.Content)

        </div>

    }

    else

    {

    <div id="mainContent" class="fc">

     

           <div id="content">

                Not Allowed

           </div>

     

        </div>

    }

    But Content.Model.ShowToVisitor() always evaluates to true. In the Package it is mentioned to be compatible with .NET 4.0 but mine framework is 4.5. This can also be causing issues. There is a binary file error while installing the package which I have noticed as below

  • Andy Butland 372 posts 2036 karma points MVP 4x c-trib
    May 11, 2015 @ 14:34
    Andy Butland
    0

    What's the name of the alias you have used for your personalisation group picker?

    I don't think the missing dll is the cause of the problem - realise I need to add that to the package which I'll do, but it's only going to be a problem if you use the country criteria.

  • Chaitanya Gadkari 27 posts 66 karma points
    May 11, 2015 @ 15:33
    Chaitanya Gadkari
    0

    Okay, 

    I missed out the part of Group Picker Alias from the description of this package, I realised this after reading your reply. It was conditionalCheck before, I changed it  to "personalisationGroups"  as mentioned in the description and everything is working fine. Thanks.

  • Andy Butland 372 posts 2036 karma points MVP 4x c-trib
    May 11, 2015 @ 15:36
    Andy Butland
    100

    Great.  You can add a config key if you want to use your original alias.  And just to note, have released another version with the missing dll in.

Please Sign in or register to post replies

Write your reply to:

Draft