Skip to Content Skip to Menu

Module: Conditional Menu (CB-Integrated)

  • cambler
  • cambler
  • OFFLINE
  • Posts: 19
  • Thanks: 0
  • Karma: 0
15 years 9 months ago #85045 by cambler
This is a module I coded-up for my own site that I thought others might find useful.

CBConditionalMenu Module (CBCMenu)

This is a simple module that will allow you to control which users can see specific menu items based on a boolean field in Community Builder. This boolean field can be any field type that is stored as an integer, though a checkbox is the recommended field type.

For each item in the menu you choose to use with this module, you will need to set the alias. The alias will then control which Community Builder field the module uses to control access to the menu item. For each alias, the module expects to find a Community Builder field named cb_cbcm[alias] (without the square brackets, of course).

For example, if you have a menu item called "Super Cool Menu Item," you might fill in the alias as "supercool" for this item. If so, the module will expect to find a Community Builder field called "cb_cbcmsupercool" to control this menu item.

If the value of the Community Builder field is 1 (one) for the current user, the menu item will be shown. If it is not 1, or there is no value, the menu item will not be shown. Normally, this would be a read-only and likely not-displayed field in Community Builder that you, as an administrator, can control. It's really that simple!

(or is that "simplistic?" :-))

This has been submitted to the extension site, but is still awaiting approval.

Download: www.amblermedia.com/index.php?option=com_rokdownloads&view=file&Itemid=99&id=2:mod_cbcmenu

Please Log in or Create an account to join the conversation.

15 years 9 months ago #85050 by deni_hanca
Replied by deni_hanca on topic Re:Module: Conditional Menu (CB-Integrated)
thank u. I'll be testing it very soon. :)

Wadya Balad Lises Unpad di www.lises-unpad.com

Please Log in or Create an account to join the conversation.

15 years 7 months ago #90019 by danathomas76
Replied by danathomas76 on topic Re:Module: Conditional Menu (CB-Integrated)
Ok. I am banging my head on the keyboard. I am missing a step I guess.

I want to have one module to the left. It will be called the usermenu. I want to have a Usermenu in joomla with lots of menu items. I want to be able to control which users can see which menu items from the backend. I have this module installed. I must be missing a step because it either shows all the menu items or none of them. Please help.

Dana

Please Log in or Create an account to join the conversation.

  • rbaker
  • rbaker
  • OFFLINE
  • Posts: 4
  • Thanks: 0
  • Karma: 0
15 years 3 months ago #103450 by rbaker
Replied by rbaker on topic Re:Module: Conditional Menu (CB-Integrated)
Well you're getting one step further than I am.
I can't get it to do anything at all.
No matter what I try I can't even get the option working that hides the menu if it's a guest user.

Frustrating because i know this will do exactly what I need for my site if I could get it working.

If anyone has got it working and can offer some advice I'd be eternally grateful!!

Please Log in or Create an account to join the conversation.

  • cambler
  • cambler
  • OFFLINE
  • Posts: 19
  • Thanks: 0
  • Karma: 0
15 years 3 months ago #103478 by cambler
Replied by cambler on topic Re:Module: Conditional Menu (CB-Integrated)
The most common problems that people are having with this module are in using the master switch incorrectly (which will give complete access to a menu), naming the fields/aliases incorrectly (you must use the proper cbcm prefix, and ensure that they match) as well as not setting the value for that field in CB after creating the field.

Remember, CB won't put a value in a newly-created field, even if you (correctly) set a default value for that field. You must, if you have existing users, populate the field with the appropriate value.

This module is a heck of a hack to get the functionality needed. I'm very pleased to see that Joomla 1.6 should make this module obsolete, as it will have this kind of access control built-in.

Please Log in or Create an account to join the conversation.

15 years 3 months ago #103480 by danathomas76
Replied by danathomas76 on topic Re:Module: Conditional Menu (CB-Integrated)
I did finally get this wrong. I had used the name wrong. Also, with existing users, if you add a menu and by default it is not selected, for some reason the existing users would see the menu until I clicked save in their profile.

Please Log in or Create an account to join the conversation.

Moderators: beatnantkrileon
Powered by Kunena Forum