Page 1 of 1

open preview of protected content

PostPosted: August 21st, 2011, 12:50 pm
by raymasa
Hi all,

Started trying s2member few days ago. Really like, great plugin.

Is there a feature that would allow me to publicly show part of a page, but protect the rest? As a teaser to get people to become member of the site to view rest of the page. For example, if there are five paragraphs on the page, the first paragraph is visible to everyone (even when not logged in). if they like that and want to read the rest, they would need top register.

Is that possible to do with s2member?

Thanks,

Ray

Re: open preview of protected content

PostPosted: August 21st, 2011, 1:52 pm
by Bruce C
Yup, you could protect the part of the page you don't want publicly visible with conditionals (Dashboard -> s2Member -> API/Scripting -> Simple/Shortcode Conditionals). Then, have a button show if they are not a member, using the [s2If !is_user_logged_in()] shortcode.

So your code could look something like this:
Code: Select all
This part is for the non-logged in users/users of a low level
[s2If !is_user_logged_in()]
...
If you would like to read more, please buy a membership here: http://example.com
[/s2If]
[s2If is_user_logged_in()]
The rest of the page.
[/s2If]


Hope that helps!

Re: open preview of protected content

PostPosted: August 22nd, 2011, 9:49 pm
by Cristián Lávaque
Ace is correct.

Another approach, if you only need the teasers in the posts list (like the home page), would be to leave Alternative Views unprotected and use the <!--more--> where you want the preview to end, then when they click to open the protected post, they'll get sent to the Membership Options Page. WP Admin -> s2Member -> Restriction Options -> Alternative View Protection

Re: open preview of protected content

PostPosted: August 24th, 2011, 8:47 pm
by raymasa
Thank you Ace of Spades and Cristián Lávaque. I have tried both solutions and they work. The more I am playing with this plugin, the more I like it.

While they both work, I really like the api method, very elegant.

Thanks again for your help.

Ray

Re: open preview of protected content

PostPosted: August 25th, 2011, 3:04 am
by Cristián Lávaque
Thanks for the kudos! I'm glad that worked for you. :)