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.

Selective display of menu items

Home Forums Community Forum Selective display of menu items

This topic contains 11 replies, has 2 voices. Last updated by  Eduan 3 years, 5 months ago.

Topic Author Topic
Posted: Friday Jul 12th, 2013 at 2:51 am #53330
Andrew Lian
Username: mlapl1

Hello

I am using the Suffusion template. I would like to know if there is any way that S2Member can control the display of individual menu items. e.g. I want some menu items appear if a user is logged in and others to appear if a user is not logged in. I have found some plugins which do give that control but Suffusion seems to over-ride them and that functionality disappears. I thought that maybe S2Member had some direct way of dealing with the problem rather than using a 3rd party plugin.

Thanks for any information

Andrew

List Of Topic Replies

Viewing 11 replies - 1 through 11 (of 11 total)
Author Replies
Author Replies
Posted: Friday Jul 12th, 2013 at 10:20 pm #53371
Eduan
Username: Eduan
Moderator

Hello Andrew,

I believe s2Member offered an option for this under Dashboard -› s2Member® -› Restriction Options -› Alternative View Protection.

– Eduan

Posted: Saturday Jul 13th, 2013 at 6:40 am #53387
Andrew Lian
Username: mlapl1

Hi Eduan

thank you – I have had a look and checked the Nav Menus box but, apart from that I have found no way to activate the menu protection: nothing appears in Appearance >> Menus or anywhere else I could identify. I looked in the help but could not find anything either. Can you please point me in the right direction?

Thanks a lot
Andrew

Posted: Saturday Jul 13th, 2013 at 6:53 am #53389
Andrew Lian
Username: mlapl1

Hi Eduan

I think I have worked out how this works BUT… how do I do this for Login and Logout… Hmmm … I guess I could do it if there is a shortcode for login and logout… Actually I think I can hide an protected page (Logout – which can appear once someone is logged in) BUT how do I protect an unprotected page/menu item (Login – which MUST appear when no one is logged in and disappear after someone has logged in)?

I will keep looking but would appreciate your opinion on this conundrum.

Thanks very much
andrew

Posted: Saturday Jul 13th, 2013 at 7:26 am #53395
Andrew Lian
Username: mlapl1

Just to clarify…

I have a menu item called “LOGIN”. It is visible when no one is logged in.

Someone logs in then:

(a) LOGIN disappears
(b) LOGOUT appears

When the user logs out LOGOUT disappears and LOGIN appears.

I know that there are plugins which allow for visibility of menu items but they are in conflict with my preferred theme (Suffusion). Hence my question.

Thanks
Andrew

Posted: Saturday Jul 13th, 2013 at 8:37 pm #53414
Eduan
Username: Eduan
Moderator

You could use PHP conditionals for that. Check under Dashboard -› s2Member® -› API / Scripting -› Advanced PHP Conditionals. :)

– Eduan

Posted: Saturday Jul 13th, 2013 at 10:10 pm #53415
Andrew Lian
Username: mlapl1

Thank you Eduan

I will try that. I guess I cannot control wp-login.php this way, but I should be able to create a page with shortcodes using a shortcodes plugin and control that page.

Let’s find out… I will report…

Andrew

Posted: Sunday Jul 14th, 2013 at 12:29 pm #53426
Eduan
Username: Eduan
Moderator

Looking forward to the results. :)

Posted: Sunday Jul 14th, 2013 at 4:51 pm #53445
Andrew Lian
Username: mlapl1

Well … you may be disappointed with the result (I was). In fact, I did not solve my problem. I did come up with an acceptable workaround though (a solution of sorts I guess).

My initial problem was to have Login, Logout and Registration tabs appear and disappear in the menu according to the login status of the user. I could have done this with a menu visibility plugin but those I could find conflicted with the theme I was using (Suffusion). I found I could control the tabs with S2Member for pages that s2Member could control using “Alternative View Protection”. However, I could not control the tabs which accessed wp-login.php or other non-pages.

I therefore found a login/logout plugin which came with shortcodes, put the shortcodes in a page, surrounded each shortcode with s2If statements. The result is that now I only have 1 tab called something like “Login/Logout/Register” which is always visible but whose content varies according to the status of the user. It is not what I wanted but it does the job (a good start), it is relatively clear and elegant and easily changeable if necessary and not too space-consuming.

Cheers and many thanks for your great help Eduan.

Andrew

Posted: Monday Jul 15th, 2013 at 9:33 pm #53480
Eduan
Username: Eduan
Moderator

Glad you found a solution that works for you Andrew. :)

Glad I was able to provide some help. :)

If you need anything else just post it. ;)

– Eduan

Posted: Monday Jul 15th, 2013 at 9:41 pm #53482
Andrew Lian
Username: mlapl1

Thank you so much Eduan. The whole forum owes you a debt of gratitude. You do so much for all of us!

Cheers
Andrew
PS. I think I did ask another question that you can help with ;-)

Posted: Saturday Jul 20th, 2013 at 8:25 pm #53739
Eduan
Username: Eduan
Moderator

Thanks! Some thanks are plenty for me. I am voluntary after all. :)

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