Custom layouts for archives with restricted access: a practical application of our new Access feature
Imagine the following.
Adam offers some training courses. He uses a WordPress site for these courses and custom post types.
Adam’s courses are available only to users who have purchased a membership plan. However, Adam would like to attract new customers as well. For this reason, for each course, he wants to show the course image and a post excerpt for anybody, including visitors, to view.
The following screenshot shows how he wants his courses page to appear for any site visitor:
However, when someone clicks on a course, Adam wants that person to see the following page:
Simultaneously, users who have access to the site (i.e., members) can see the post content:
To protect his courses from unprivileged users, Adam uses the Toolset Access plugin for the Advance Tutorial post type. The Read option is left unchecked for Guests; therefore, unregistered visitors will not see these posts:
How do we make only the post excerpt and images visible to guests on the course archive page?
The main fact is: if you restrict access for a certain post type, unprivileged users will see the “No posts found” message instead of the post type archive page. This makes sense, as access to the post type is forbidden for a specific reason. Still, how can we help Adam attract new customers? Potential customers must see something to become interested in his courses.
We must create an archive that shows only the post titles, images, and excerpts (or any content that will lure in prospective customers) and use it to display to users without read permission.
We can do this using the little pen icon on the Access screen:
When you click on it, the following pop-up dialog appears:
If you are not using Layouts, you can instead assign a WordPress Archive created with Toolset Views.
Adam’s problem is solved. Adam is happy, as his page now attracts new leads. Potential customers are happy, as they can see Adam’s full offer before they buy.
We hope you too will be happy if this type of feature is needed for your Toolset project built with the Toolset Layouts and Access plugins. Our documentation for Toolset Access will assist you.