PriMoThemes — now s2Member® (official notice)

This is now a very OLD forum system. It's in READ-ONLY mode.
All community interaction now occurs at WP Sharks™. See: new forums @ WP Sharks™

Custom message to appear in place of protected content?

s2Member Plugin. A Membership plugin for WordPress®.

Custom message to appear in place of protected content?

Postby jacko » November 1st, 2010, 2:46 pm

Hey guys, great plugin! I've been playing around with the simple conditionals trying to hide/protect sections of my posts and pages.

Is there a way I can force a message to appear in place of the hidden/protected section, advising visitors to pay in order to access/read it?

My website structure is uber simple: I have a single membership level for paid members, roughly 10% of total content. Visitors can access the other 90% of free content (obviously paying members can as well).

Looking in the example below, a visitor would never know there was content hidden from him (Sentence 1).

[s2If current_user_can(access_s2member_level1)] Some content for Members who are logged in with an s2Member Level >= 1. [/s2If]

Some public content available to visitors, blah blah blah.


Is there a way for a custom message to appear in place of Sentence 1, or in any place I hide content?
User avatar
jacko
Registered User
Registered User
 
Posts: 2
Joined: November 1, 2010

Re: Custom message to appear in place of protected content?

Postby chelle » November 1st, 2010, 5:39 pm

This is how I do it on my site:

[s2If current_user_can(access_s2member_level1)]
Here is the members only content.
[/s2If]

[s2If !current_user_can(access_s2member_level1)]
Here's where I write: Not a member yet? Sign Up!
[/s2If]

The difference between the first one and the second one is the ! in the second one.

If you are writing a lot of posts with this type of thing, I decided to install the Pre-Publish reminder plugin and copy/pasted this code, so for each post I write, it shows up in the post dashboard so I just have to copy/paste it into the content each time.

Hope that helps!
User avatar
chelle
Registered User
Registered User
 
Posts: 41
Joined: September 6, 2010

Re: Custom message to appear in place of protected content?

Postby jacko » November 2nd, 2010, 3:57 am

Thanks, that worked! Though I was hoping for something a bit more automated.

All the other major membership plugins have this embedded in the core functions, I'm surprised S2members with all its elegant solutions need us to enter the code manually each time we protect content.

I still think S2member is the best membership plugin out there, but is there really no other way around this? Perhaps a member of the S2member team can clarify...
User avatar
jacko
Registered User
Registered User
 
Posts: 2
Joined: November 1, 2010

Re: Custom message to appear in place of protected content?

Postby KirkWard » November 2nd, 2010, 7:46 am

jacko wrote:All the other major membership plugins have this embedded in the core functions, I'm surprised S2members with all its elegant solutions need us to enter the code manually each time we protect content.

Hi Jacko,

I'm own about a half dozen membership plugins, several of them are very highly regarded.

I've been looking at and playing with s2 for a short while now, and even the free version seems more powerful than any of the others. One of the reasons is the fact that it gives you more freedom to code.

I think that if you look at all the others you are talking about, they do not have any way of performing some of the really, really, advanced tasks that s2 makes accessible.

I'm thinking that the closer you get to the core, the more work you have to do, but also, the more freedom you are given.

Kirk
User avatar
KirkWard
Experienced User
Experienced User
 
Posts: 61
Joined: October 22, 2010


Return to s2Member Plugin

Who is online

Users browsing this forum: Google [Bot] and 4 guests

cron