[SOLVED] Allow Photo Gallery module to only show photos of specific users

4 years 5 months ago - 4 years 4 months ago #314982 by boyjahq
I have 2 different types of user in my CB and CBSubs configuration. Those users can be identified by user group or by a specific field that I have created in CB (cb_usertype).

I would like to have photos appear in the Photo Gallery module only from one of those specified groups. Is there a way to apply a condition to the module so that it only shows photos from cb_usertype = h or from usergroup = host? I tried every combination of things I could think of in the Gallery/Asset setting in the module, but was not successful.

Please Log in to join the conversation.

4 years 5 months ago #314988 by krileon
Nope, you can't filter a gallery by a field like that. Best I could suggest is create a Gallery field that only those users can access (e.g. condition it via CB Conditional or use tab access permissions) then output that fields gallery in your module.


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.

Please Log in to join the conversation.

4 years 5 months ago #314994 by boyjahq
Does that mean that it is possible to make more than one gallery? If so, how can I make different galleries for each of the 2 categories of users?

Please Log in to join the conversation.

4 years 5 months ago #314997 by krileon
Yes, you can make an unlimited amount of galleries. What a gallery displays is entirely dependent on the Asset the gallery has. By default Gallery fields have an asset specific to that users profile and that field (e.g. profile.42.field.3) while the Gallery tab is just specific to that users profile (e.g. profile.42). See the Asset parameter description for usage information. In your case yes just make 2 Gallery fields and limit access to those 2 categories of users however you see fit (e.g. access permission on their tab or CB Conditional).


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.

Please Log in to join the conversation.

4 years 5 months ago #315014 by boyjahq
Excellent! Thank you for this guidance. I have made the 2 separate galleries but I can't figure out the proper way to specify which gallery I want to show in the Photo Gallery module. What do I put into the Asset field to get photos from a specific gallery to show?

Please Log in to join the conversation.

4 years 5 months ago #315025 by krileon
Gallery fields have a default asset of profile.USER_ID.field.FIELD_ID. So lets say you want to show the gallery entries for field 30 of user 42 you'd have an asset of profile.42.field.30 which you'd add to the asset parameter of your gallery module. Please read the description of the asset parameter carefully as it does support wildcards and many other features and you can supply multiple assets to a gallery as well.


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.

Please Log in to join the conversation.

Moderators: beatnantkrileon
Time to create page: 0.235 seconds

Facebook Twitter LinkedIn