So, I built an EE site. Per my instructions, there’s a section of content that is restricted to users who are logged into the site. All good so far,
Now, we’d like to selectively display some of that content to non-authenticated users. For example, we want to open up one of the posts for a few days, but keep the rest restricted.
Ideally, this needs to be something that doesn’t require changes to the template every time we want to display a post. The people opening up these posts don’t have the skills to do that.
I was thinking there might be a way to assign a new category or status that gets around the need to be logged in to view a post, but I haven’t thought through that idea yet.
Any suggestions?
Thanks.
Lamar
EE v2.9.0 - Build Date: 20140715
What method did you use to hide the content in the template? Seeing your template code would help. Assuming you used a conditional like
{exp:channel:entries ...}
{if logged_in_member_id}
{/if}
{/exp:channel:entries}
Then you can just add the new condition
{exp:channel:entries ...}
{if logged_in_member_id || "{categories}{category_url_title}|{/categories}" *= "free-entry"}
{/if}
{/exp:channel:entries}
You would then assign any entries that are to be made available to non-logged in users the “free-entry” category.
This will only work if the conditional is inside the channel:entries tag. The tag uses the “contains” *= operator to search through the list of categories for the one you want.
Packet Tide owns and develops ExpressionEngine. © Packet Tide, All Rights Reserved.