Restrict Access

Password-protect part of a website's frontend so only logged-in contacts can see it. Two pieces work together: a folder-level flag that marks a folder as restricted, and a shortcode that actually enforces the redirect on each protected page.

Mark the folder

Go to the folder you want to restrict, click on the ... menu and open Update, and expand Website Properties. Check Restrict Access in Website to Authorized Users and click Submit.

Restrict Access in Website to Authorized Users checkbox

See Update Folder for information on the remaining fields in the form.

Enforce it on a page

Add the shortcode provided below to the top of any page that needs to be protected:

[contact_form_session]

If the visitor does not have a logged-in contact session, they are redirected before the rest of the page is rendered.

Options:

Attribute Description
forward_to The URL to redirect an unauthenticated visitor to. Defaults to the website's login page if one is configured; otherwise, /login.stml.
[contact_form_session forward_to="/login/"]

The redirect appends ?next_url= with the page the visitor originally tried to access, allowing the login page to redirect them back after they sign in.

Build the login page

  1. Add a page to hold the login form.
  2. Add the Contact Form Login shortcode to it, and point forward_to at wherever a signed-in visitor should land.