{%if(viewmode == "livesite"){%} is working in all layout except master page layout

Ranapratap Bhopale asked on June 13, 2018 14:57

{%if(viewmode == "livesite"){%} some cmsWebParts/HTML {% } #%}

The above code is working in all layout except master page layout. I tried for {% if (PortalContext.ViewMode == "LiveSite") { %} using {% using CMS.PortalEngine.PortalContext.ViewMode; #%} this library ....all works with child page layout but not in master page layout.I want this same thing for master page layout

Correct Answer

Rui Wang answered on June 13, 2018 15:44

I added {% if(ViewMode == "LiveSite"){ %} hello {% } #%} to master page layout and it does show "hello" in live site only.

  1. Is your mater page using HTML or ASCX, it has to be HTML for macro to work
  2. What version and hotfix are you on?
0 votesVote for this answer Unmark Correct answer

   Please, sign in to be able to submit a new answer.