Carry out the following steps:
We've already seen how we can hide a page or even a block from a user by using the concrete5 user interface in combination with the advanced permission mode.
Let's hide content by using some code. Put the following lines in
default.php
:
The preceding two Time for action sections can both be used to change the content by adding some logic to the template.
While we've put both of them in a theme template, they are not only restricted to this location. You can use the command new User
almost anywhere in concrete5. The method isEditMode
also works at several places, theme templates, page list templates, or autonav templates.