Skip to Content Skip to Menu

[SOLVED] Default Photo Gallery

  • Spiralmind
  • Spiralmind
  • OFFLINE
  • Posts: 259
  • Thanks: 16
  • Karma: 0
6 years 10 months ago - 6 years 10 months ago #299797 by Spiralmind
[SOLVED] Default Photo Gallery was created by Spiralmind
Hello, there is a photo gallery on my users profile that is not a field for me to manage. I need to add some instructions so they fill in the title and description for each photo they upload. This must be the system added gallery?

So 2 questions:

1. Can I somehow set the Title and Description fields to be required so they must do it? It says in the tooltip "optionally supply a title...." which I would like to be required instead.

2. If not how could I add some text to the upload page where they upload the photos? A language string edit is fine if that is easiest.

Thank you
Last edit: 6 years 10 months ago by krileon. Reason: Added [SOLVED] tag to subject

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

  • krileon
  • krileon
  • ONLINE
  • Posts: 48444
  • Thanks: 8279
  • Karma: 1443
6 years 10 months ago #299813 by krileon
Replied by krileon on topic Default Photo Gallery

Hello, there is a photo gallery on my users profile that is not a field for me to manage. I need to add some instructions so they fill in the title and description for each photo they upload. This must be the system added gallery?

That's the Gallery tab provided by CB Gallery. It does not allow fields to be added to it.

1. Can I somehow set the Title and Description fields to be required so they must do it? It says in the tooltip "optionally supply a title...." which I would like to be required instead.

No, CB Gallery does not require a title or description to function. Only way to change this is to modify the core code.

2. If not how could I add some text to the upload page where they upload the photos? A language string edit is fine if that is easiest.

You can use gallery_onBeforeItemsNew with a Code action to output some HTML or whatever you like above the upload input. Example as follows.

Global
Triggers: gallery_onBeforeItemsNew
Type: Code
User: User
Access: Everybody
Action
Method: HTML
Code:
Code:
<div>Hello World!</div>
Output
Display: return


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 or Create an account to join the conversation.

  • Spiralmind
  • Spiralmind
  • OFFLINE
  • Posts: 259
  • Thanks: 16
  • Karma: 0
6 years 10 months ago #299828 by Spiralmind
Replied by Spiralmind on topic Default Photo Gallery
That works, thank you!

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

  • Spiralmind
  • Spiralmind
  • OFFLINE
  • Posts: 259
  • Thanks: 16
  • Karma: 0
6 years 10 months ago #300229 by Spiralmind
Replied by Spiralmind on topic Default Photo Gallery
Hello, is there any way to have more than one of these and assign them to specific galleries? I have a couple different galleries that need different descriptions.

Thank you

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

  • krileon
  • krileon
  • ONLINE
  • Posts: 48444
  • Thanks: 8279
  • Karma: 1443
6 years 10 months ago #300240 by krileon
Replied by krileon on topic Default Photo Gallery
The variables for that trigger are as follows.

Code:
$_PLUGINS->trigger( 'gallery_onBeforeItemsNew', array( $viewer, $gallery ) );

You can probably use the below format function to call the asset function to get the primary asset for the gallery.

Code:
[cb:parse function="asset" class="var2" /]

You'd then condition that for example and have an auto action per asset. So if you wanted it to only display on profile galleries the below condition should work.

Code:
[cb:parse function="asset" class="var2" /] Is REGEX /^profile\.(\d+)$/


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.
The following user(s) said Thank You: Spiralmind

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

Moderators: beatnantkrileon
Powered by Kunena Forum