latest stable versions: v150827 (changelog)

Old Forums (READ-ONLY): The community now lives at WP Sharks™. If you have an s2Member® Pro question, please use our new Support System.

How to display content based on member level?

Home Forums Community Forum How to display content based on member level?

This topic contains 4 replies, has 3 voices. Last updated by  Cristián Lávaque 4 years, 1 month ago.

Topic Author Topic
Posted: Saturday Nov 10th, 2012 at 12:58 pm #31229
John Abadi
Username: jabadi

I am sure this is covered somewhere but I am unable to find it. I want to conditionally display content on some pages based on what member level a subscriber has. How is this done?

Also, is there a way in the standard WP theme to eliminate the welcome login page from displaying in the menu? This is a page that should not persist in the main navigation of the site.

Any help is appreciated!

John

List Of Topic Replies

Viewing 4 replies - 1 through 4 (of 4 total)
Author Replies
Author Replies
Posted: Saturday Nov 10th, 2012 at 1:06 pm #31230
cassel
Username: cassel

I am sure this is covered somewhere but I am unable to find it. I want to conditionally display content on some pages based on what member level a subscriber has. How is this done?

You can use conditionals in the shortcode form like this:

[s2If current_user_is(s2member_level4)]
   Some premium content for Level 4 Members.
[/s2If]

[s2If current_user_is(s2member_level3)]
   Some premium content for Level 3 Members.
[/s2If]

[s2If current_user_is(s2member_level2)]
   Some premium content for Level 2 Members.
[/s2If]

[s2If current_user_is(s2member_level1)]
   Some premium content for Level 1 Members.
[/s2If]

[s2If current_user_is(s2member_level0)]
   Some content for Free Subscribers.
[/s2If]

[s2If !current_user_can(access_s2member_level0)]
   Some public content.
[/s2If] 

So everything can be on the same page, but only the content specific for a particular level will show up. Note that if you are admin, you might not see what the members see so create yourself a test member that will be assigned alternatively the different levels so you can see from the test member’s angle.

You can find more about the conditionals (and there is a lot more that you can do if you want) in your s2Member > Api/Scripting.

Let us know if you run into any problem (or if it works fine too).

Posted: Saturday Nov 10th, 2012 at 2:29 pm #31233
John Abadi
Username: jabadi

That worked like a champ. Thank you.

Also, can you address my second question? (I cannot seem to find a way to suppress the login welcome page from showing in the main nav menu – it does not make contextual sense for a site visitor/non-subscriber to see that in the site’s nav)

Posted: Saturday Nov 10th, 2012 at 2:43 pm #31234
cassel
Username: cassel

I would not be able to answer the second question. I dont have the login among the pages on my navigation so i would not know. Maybe you can edit that in the WP custom menus?

Posted: Monday Nov 12th, 2012 at 7:43 am #31289

Also, can you address my second question? (I cannot seem to find a way to suppress the login welcome page from showing in the main nav menu – it does not make contextual sense for a site visitor/non-subscriber to see that in the site’s nav)

You can hide protected pages (Login Welcome is protected at Level 0) from the navigation menus. [hilite path]Dashboard -› s2Member® -› Restriction Options -› Alternative View Protection -> Nav Menus[/hilite]

Viewing 4 replies - 1 through 4 (of 4 total)

This topic is closed to new replies. Topics with no replies for 2 weeks are closed automatically.

Old Forums (READ-ONLY): The community now lives at WP Sharks™. If you have an s2Member® Pro question, please use our new Support System.

Contacting s2Member: Please use our Support Center for bug reports, pre-sale questions & technical assistance.