Web page permissions

Blank 4/9/2019 04:47 - 4/9/2019 04:47
Editing Content Website Management

Often you want a website which has a mixture of pages which can be accessed by anyone without logging in, and also some pages which are locked down to only be viewed by logged in users in certain groups

There are quite a few options in Kademi for doing that, this guide shows you a simple way to do it using templates and conditional containers.

Steps

Here's how we'll do it.

  1. Duplicate the default page template, to create a non-secure page, ie this will be the template for publicly viewable pages
  2. Update the default page template to be used for secure content. It will show a login page for non-logged in users, and display normal content for users in a specific group
  3. Create a non-secure page which uses the non-secure template
  4. Create a secure page which uses the secure page template

Step 1 - Duplicate the default page template, to create a non-secure page, ie this will be the template for publicly viewable pages

Start off on manage web pages, where you can see your list of templates and pages in the root directory

Click on the "page" template, at lower right, this will create a template override in your account so you can duplicate it and edit it

This will open the template editor in a new tab. Leave that editor open, we'll come back to it after duplicating the template.

Go back to manage web pages and click on the "File manager" icon to view your website files.

Then click into the "theme" directory to view your templates

Then copy and paste the "page.html" file, and rename it to "non-secure-page.html"

Step 2 - Update the default page template to be used for secure content. It will show a login page for non-logged in users, and display normal content for users in a specific group

Now return to the editor tab you opened in step1

We'll update the container holding the page template body component to only display content for a specific group

- click anywhere in the row

- click the cog that displays to the left of the content

- select the group or groups you want to be able to see content. Note that there is no option for all logged in users, you must specify particular groups.

Now we'll insert a new container (i'll use a 3 col container) and select "Anonymous" as the target group, and add a login component

Now save the file.

Step 3. Create a non-secure page which uses the non-secure template

Return to manage web pages and create a new page, and select the new "non-secure-page" template for this page.

Step 4. Create a secure page with the default template

This is the easy bit. Just create a page with the default page template

All done

You can now confirm that the 2 pages have different behaviour by viewing them from the admin page (using the login option) and then logging out and viewing the same page again.

Here's the secure page when being viewed anonymously.