ExpressionEngine® Answers Asked by huckbit on October 3, 2021
is it possible in expressionengine 5 to have private pages?
I know it’s possible to create a forum but what about pages with content just for registered users?
Thanks in advance for your help.
There's also the method of going into a template's settings, Access tab, and checking "Enable HTTP Authentication". That checkbox, combined with the member groups you check to have access right above it can also password-protect certain templates.
Answered by jphansen on October 3, 2021
Yes private pages are easily do-able. There are numerous approaches, here's one using a template to control who can view content.
Create a template and add some conditional tags to determine if the person is logged out (show login form), or logged in (show the content)
Assuming that anyone that is logged in can see content
{if logged_out}
YOUR LOGIN FORM
{/if}
{if logged_in}
YOUR PRIVATE CONTENT
{/if}
Only allow access to a specific member group
{if logged_out}
YOUR LOGIN FORM
{/if}
<!-- only allow member group 5 to access content -->
{if logged_in_group_id == "5"}
YOUR PRIVATE CONTENT
{/if}
<!-- if logged in member group is not 5 -->
{if logged_in_group_id != "5"}
You're logged in but not allowed to see content
{/if}
Answered by Bluedreamer on October 3, 2021
EE doc search works pretty well these days, and the info is all there.
Login and registration: https://docs.expressionengine.com/latest/member/index.html
Member groups: https://docs.expressionengine.com/latest/control-panel/member-manager.html#member-groups
Controlling access to templates: https://docs.expressionengine.com/latest/control-panel/template-manager.html#access
Answered by Zack on October 3, 2021
Get help from others!
Recent Questions
Recent Answers
© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP