Page 1 of 1
shortcodes for partial viewing of content
Posted:
November 5th, 2011, 11:48 am
by tarotelements
I want to provide some of the content on my pages to be visible and available as free but I would also like to restrict part of the content as premium. So the first portion would be free and the following portion premium and requiring either a single purchase of the rest of the content or a subscription option to read it.
Does s2member provide shortcodes that can fulfill that?
Many thanks,
Catherine
Re: shortcodes for partial viewing of content
Posted:
November 5th, 2011, 11:58 am
by Eduan
For a simple way try going under
WP Admin -> s2Member -> API / Scripting -> Simple/Shortcode Conditionals and see if you find what you need there.
For a more advanced way try this couple of videos:
http://www.s2member.com/api-scripting-overview-video/http://www.s2member.com/advanced-conditionals-video/You can find everything under
WP Admin -> s2Member -> API / Scripting.
Hope this helps.
Re: shortcodes for partial viewing of content
Posted:
November 5th, 2011, 12:50 pm
by tarotelements
Thanks for your help, Eduan - it seems I have a bit more to learn there, but at least it's possible
Re: shortcodes for partial viewing of content
Posted:
November 5th, 2011, 1:04 pm
by Eduan
Okay,
well anything else you need just ask.
Re: shortcodes for partial viewing of content
Posted:
November 5th, 2011, 1:18 pm
by tarotelements
No worries, I will
Re: shortcodes for partial viewing of content
Posted:
November 5th, 2011, 2:13 pm
by Eduan
Re: shortcodes for partial viewing of content
Posted:
November 5th, 2011, 2:57 pm
by tarotelements
I'm back, already....
The shortcodes all seem to require a person to be logged in to see content, even when it's being made freely available. Is it possible to put the shortcode below the free non-subscriber content and use one that then asks for login to continue?
Re: shortcodes for partial viewing of content
Posted:
November 5th, 2011, 4:00 pm
by Eduan
You mean put "login required" content and if the user isn't registered put something saying "please register"?
Also what content levels are you offering.
Re: shortcodes for partial viewing of content
Posted:
November 5th, 2011, 4:04 pm
by tarotelements
Yes. After a certain amount of free content at the beginning of the page then block it unless logged in or offer registration. Can it be done? I can't see which of these shortcodes will work. I've played around with some different configurations on one page to test it without success
Re: shortcodes for partial viewing of content
Posted:
November 5th, 2011, 4:09 pm
by tarotelements
Free content meaning public, that no-one needs to be a registered user for, not even a 0 membership.
Re: shortcodes for partial viewing of content
Posted:
November 5th, 2011, 4:10 pm
by Eduan
Try this:
- Code: Select all
[s2If current_user_is(s2member_level0)]
Some content for Free Subscribers.
[/s2If]
[s2If !current_user_can(access_s2member_level0)]
Some public content.
[/s2If]
Or this (you will need the
Exec-PHP plugin):
- Code: Select all
<?php } else if (current_user_is("s2member_level0")){ ?>
Some content for Free Subscribers.
<?php } else { ?>
Some public content.
<?php } ?>
Re: shortcodes for partial viewing of content
Posted:
November 5th, 2011, 4:25 pm
by tarotelements
Hey Eduan,
That's great, thank you. However, after the free content, there's no login or register options that follow. Do I have to add some other shortcode or link?
Re: shortcodes for partial viewing of content
Posted:
November 5th, 2011, 4:27 pm
by Eduan
Do you have the PRO version?
Re: shortcodes for partial viewing of content
Posted:
November 5th, 2011, 4:35 pm
by tarotelements
No, just the free one - does that make a difference to what's available?
Re: shortcodes for partial viewing of content
Posted:
November 5th, 2011, 4:40 pm
by Eduan
Well the paid version has what you call a Pro-form, which is basically the registration form or the PayPal button but without leaving the page you're in. There's also a free registration pro-from.
If you can't afford it the best you can do, at least from what I know, is put this link for them, maybe with an image:
http://www.yoursite.com/wp-login.php?action=register.
Hope this helps.
Re: shortcodes for partial viewing of content
Posted:
November 5th, 2011, 4:52 pm
by tarotelements
I'll check that out, thanks Eduan.
Can I just ask your opinion on what's the best to use, the shortcodes or the php with the plugin? Are there any performance differences etc?
Re: shortcodes for partial viewing of content
Posted:
November 5th, 2011, 4:53 pm
by Eduan
There's really no difference in perfomance, it's just that wit the PHP you have a little more control since you can customize the code.
Re: shortcodes for partial viewing of content
Posted:
November 5th, 2011, 4:58 pm
by tarotelements
If you can write with it... lol.
Thanks for your help tonight, Eduan - you're been great!
Re: shortcodes for partial viewing of content
Posted:
November 5th, 2011, 4:59 pm
by Eduan
Yeah.
You're welcome, anything else you need just ask.
By the way to buy the Pro version's licenses you can use this link:
http://www.s2member.com/prices/
Re: shortcodes for partial viewing of content
Posted:
November 5th, 2011, 10:20 pm
by Cristián Lávaque
- Code: Select all
Free content first.
[s2If !current_user_can(access_s2member_level0)]
The user is not logged in, ask him to register and/or log in.
http://yoursite.com/wp-login.php
http://yoursite.com/wp-login.php?action=register
[/s2If]
[s2If current_user_can(access_s2member_level0)]
Content for logged in users.
[/s2If]
[s2If !current_user_can(access_s2member_level1)]
The user can't access Level 1 content. Button to upgrade.
[/s2If]
[s2If current_user_can(access_s2member_level1)]
Content for users at Level 1 or higher.
[/s2If]
Does that help?
Re: shortcodes for partial viewing of content
Posted:
November 6th, 2011, 12:43 pm
by tarotelements
Thanks Cristian - I'll give these a try after dinner
Re: shortcodes for partial viewing of content
Posted:
November 6th, 2011, 10:10 pm
by Cristián Lávaque
Cool. Let us know if you have more questions.