Hiding sections of page layout until logged in

May 8, 2014 2:49 pm

I have a secured page. On this page, my client wants the login box only, with no right column visible. The right column will be shown after they have logged in. I am using a display
type called ‘MainDisplay’, based on a page layout ‘Main'. In Green > Layout > Edit this display type > Login display type field is set to 'This Page'.

The field which is set to 'This Page' is what you'll want to change. Assuming you have another display type based on a page layout which doesn't have the column, you can change 'This Page' to that display type and it'll use that display type to login. You could even go as far as making it a setting so you wouldn't have to maintain two page layouts.

To make this a setting, go to Green -> Pages -> and edit ‘Main’ so the html around the column looks like this:

<if [[setting.showColumn]] == "No">
<else>
<div>
{column HTML goes here}
</div>
</if>

Then while in still in page layout ‘Main' click the icon which looks like a red padlock with an x, and add a new setting and name it 'showColumn', and change the input type to a 'Select List' and add two options 'No' and 'Yes' (capitalization matters on all these settings) then hit Save.

Next create a new display type named ‘MainDisplaySecure’ and make sure it's based off the page layout ‘Main’ which we just edited. You should see an option to show column. Select No and hit save. The way we just wrote the statement previous page layout ‘MainDisplay' should not be affected by the setting because it'll default to showing the column unless the setting is set to No.

Finally, go back to Green -> Display Type -> and edit the page you want to secure - in this case ‘MainDisplay' and from the 'Login Display Type' drop down change it from 'This Page' to ‘MainDisplaySecure’.

The result of your effort you will have a page which does not show the column until a user has logged in.

Before logging in:

After logging in: