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.

Different sidebar options based on ccaps?

Home Forums Community Forum Different sidebar options based on ccaps?

This topic contains 2 replies, has 2 voices. Last updated by  Andrea Whitmer 4 years, 7 months ago.

Topic Author Topic
Posted: Saturday May 19th, 2012 at 2:00 pm #13988

I understand that this question may fall outside the realm of support, but I thought I’d give it a shot.

I’m using s2Member as a client portal, and so far I’ve been able to implement everything I need except one thing – I’d like to show links in the sidebar for each client’s child pages depending on which ones they have.

Basically, there are 10 possible child pages that could exist under each user ID. Some clients will have all of them, while others may only have 2 or 3. I’m trying to figure out a way to show only those links that apply to individual clients in the sidebar, based on their ccaps. So if User A is allowed access to these 5 pages, I want those pages to be linked in the sidebar when User A is logged in. User B may have some of the same pages for their user ID, but the ones that don’t exist for User B won’t display. I’m not sure if there’s some kind of functionality within s2Member to do this or if it’s going to require a PHP function.

I’m able to create the links easily using %%current_user_login%% in the URL, but I can’t figure out how to get them to display based on whether a particular URL exists for that user. Any ideas?

List Of Topic Replies

Viewing 2 replies - 1 through 2 (of 2 total)
Author Replies
Author Replies
Posted: Sunday May 20th, 2012 at 1:23 am #14005

Hello Andrea,

In a text widget in the sidebar, or in your s2member pro login widget in the Additional XHTML/PHP Code? section ( when logged-in ) you could use:

[s2If current_user_can(access_s2member_ccap_clientA)]
        Display links for Client A
[/s2If]
[s2If current_user_can(access_s2member_ccap_clientB)]
        Display links for Client B
[/s2If]
[s2If current_user_can(access_s2member_ccap_clientC)]
        Display links for Client C
[/s2If]

You can find out more under s2Member® API / Scripting > Advanced/PHP Query Conditionals or Custom Capabilities

Hope that helps

Posted: Sunday May 20th, 2012 at 1:25 am #14006

Thanks! That makes a lots of sense. I’ll try it out and see how it goes.

Viewing 2 replies - 1 through 2 (of 2 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.