Skip to Content Skip to Menu

[SOLVED] Add menu depending on user id

  • activha
  • activha
  • OFFLINE
  • Posts: 2327
  • Thanks: 117
  • Karma: 13
10 years 8 months ago - 10 years 8 months ago #240770 by activha
Hello
We have an auto action to add a menu to another component. This auto action works great but the menu is seen on all users pages.

In order to limit it to the logged in user only we added a condition which is :
[user_id] egals [cb:userfield field="user_id" user="#me" /]

this is not working and with this condition, the menu is not displayed.

Could you tell me what I miss here ?
Last edit: 10 years 8 months ago by krileon.

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

  • krileon
  • krileon
  • ONLINE
  • Posts: 48477
  • Thanks: 8281
  • Karma: 1443
10 years 8 months ago - 10 years 8 months ago #240823 by krileon
Replied by krileon on topic Add menu depending on user id
Try the following so it's independent of the trigger user object.

Conditional 1: [cb:userfield field="user_id" user="#me" /] Greater Than 0
Conditional 2: [cb:userfield field="user_id" user="#displayed" /] Equal To [cb:userfield field="user_id" user="#me" /]


Kyle (Krileon)
Community Builder Team Member
Before posting on forums: Read FAQ thoroughly + Read our Documentation + Search the forums
CB links: Documentation - Localization - CB Quickstart - CB Paid Subscriptions - Add-Ons - Forge
--
If you are a Professional, Developer, or CB Paid Subscriptions subscriber and have a support issue please always post in your respective support forums for best results!
--
If I've missed your support post with a delay of 3 days or greater and are a Professional, Developer, or CBSubs subscriber please send me a private message with your thread and will reply when possible!
--
Please note I am available Monday - Friday from 8:00 AM CST to 4:00 PM CST. I am away on weekends (Saturday and Sunday) and if I've missed your post on or before a weekend after business hours please wait for the next following business day (Monday) and will get to your issue as soon as possible, thank you.
--
My role here is to provide guidance and assistance. I cannot provide custom code for each custom requirement. Please do not inquire me about custom development.
Last edit: 10 years 8 months ago by krileon.

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

  • activha
  • activha
  • OFFLINE
  • Posts: 2327
  • Thanks: 117
  • Karma: 13
10 years 8 months ago #240856 by activha
Replied by activha on topic Add menu depending on user id
Nope did not work... :-(

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

  • krileon
  • krileon
  • ONLINE
  • Posts: 48477
  • Thanks: 8281
  • Karma: 1443
10 years 8 months ago - 10 years 8 months ago #240864 by krileon
Replied by krileon on topic Add menu depending on user id
The below should ensure &user isn't in the URL. Viewing self normally does not have &user appended so the below should work ok.

Conditional 1: to_integer([get_user]) Equal To 0

Aside from that I don't know what to tell you. It's just trial and error until a combo does what you're wanting.


Kyle (Krileon)
Community Builder Team Member
Before posting on forums: Read FAQ thoroughly + Read our Documentation + Search the forums
CB links: Documentation - Localization - CB Quickstart - CB Paid Subscriptions - Add-Ons - Forge
--
If you are a Professional, Developer, or CB Paid Subscriptions subscriber and have a support issue please always post in your respective support forums for best results!
--
If I've missed your support post with a delay of 3 days or greater and are a Professional, Developer, or CBSubs subscriber please send me a private message with your thread and will reply when possible!
--
Please note I am available Monday - Friday from 8:00 AM CST to 4:00 PM CST. I am away on weekends (Saturday and Sunday) and if I've missed your post on or before a weekend after business hours please wait for the next following business day (Monday) and will get to your issue as soon as possible, thank you.
--
My role here is to provide guidance and assistance. I cannot provide custom code for each custom requirement. Please do not inquire me about custom development.
Last edit: 10 years 8 months ago by krileon.

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

  • activha
  • activha
  • OFFLINE
  • Posts: 2327
  • Thanks: 117
  • Karma: 13
10 years 8 months ago #240880 by activha
Replied by activha on topic Add menu depending on user id
Well done that works very well :-)

Thanks a lot

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

Moderators: beatnantkrileon
Powered by Kunena Forum