Skip to Content Skip to Menu

🕒 Save Time and Effort with CB Editor Assistant: Effortlessly create and refine content in Joomla 3, 4, & 5.
🎁 Limited Offer: Enjoy a 5-day FREE trial and save up to 30% afterward!

Gallery with two different templates ?

  • rbuelund
  • rbuelund
  • OFFLINE
  • Posts: 574
  • Thanks: 40
  • Karma: 4
7 years 10 months ago #291982 by rbuelund
Gallery with two different templates ? was created by rbuelund
Is it possible to show the same user gallery in to different gallery fields, with two different templates and on two dìfferent panes on the profile ? I need two be able to show some information about the gallery, and ceratin images on the one pane and different information and different images from the gallery on the other pane.

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

  • krileon
  • krileon
  • ONLINE
  • Posts: 48709
  • Thanks: 8319
  • Karma: 1447
7 years 10 months ago #291992 by krileon
Replied by krileon on topic Gallery with two different templates ?
It is currently not possible to select a different template per gallery. This is planned as noted in the below feature ticket.

forge.joomlapolis.com/issues/6354

I have to completely rewrite all the template usages and how they're included to implement this so it won't be for awhile. Your only option at this time is to style your additional galleries purely with CSS and if using gallery fields you can use the layout parameters or add a field above/below the gallery field for additional information.


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.

  • rbuelund
  • rbuelund
  • OFFLINE
  • Posts: 574
  • Thanks: 40
  • Karma: 4
7 years 10 months ago - 7 years 10 months ago #292001 by rbuelund
Replied by rbuelund on topic Gallery with two different templates ?
Hmm.. then I need to do something different. Is it possible to use the cb_conditional setting for a field in the items.php file of the gallery plugin ?
What I want is to show certain extra profile fields in the gallery based on if a checkbox is set or not (This checkbox field should also be visible in the gallery, so that the user can change the view) - in that way I would be able to change between images listed without the profile fields and images listed with the connected profile fields.
I need to do this inside the items.php file of the gallery, beacuse i list the image files in a certain way, based on their file name (which works perfectly), and now I need to show a profile field based on a part of the filename - just beneath the respective image.
Can this be done ?
Last edit: 7 years 10 months ago by rbuelund.

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

  • rbuelund
  • rbuelund
  • OFFLINE
  • Posts: 574
  • Thanks: 40
  • Karma: 4
7 years 10 months ago #292009 by rbuelund
Replied by rbuelund on topic Gallery with two different templates ?
I've now gotten to the point where I am able to show a radio button field and a text field on the gallery page with this code in items.php:
Code:
$userobject = $gallery->user(); $actualuserid = $userobject->get('user_id'); $cbUser =& CBuser::getInstance($actualuserid); if ( ! $cbUser ) { $cbUser =& CBuser::getInstance( null ); } $testfield1 = $cbUser->getField( 'cb_profiledisplaytype', null, 'htmledit', 'none', 'edit' ) ; echo($testfield1); $testfield2 = $cbUser->getField( 'cb_logo1description', null, 'html', 'none', 'profile' ) ; echo($testfield2);

But if I change the value of cb_profiledisplaytype - it is not hiding the cb_logo1description - which I have set with the conditional plugin - is that not possible to get to work this way ?

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

  • krileon
  • krileon
  • ONLINE
  • Posts: 48709
  • Thanks: 8319
  • Karma: 1447
7 years 10 months ago #292036 by krileon
Replied by krileon on topic Gallery with two different templates ?
I don't understand what you're trying to do, sorry. Why are you outputting the edit view of a field in that gallery view? There's no code to save it so it won't do anything. Do not directly echo, but instead add it to the $return wherever necessary. No CB Conditional will not condition what you're trying to do with its jQuery (edit conditions are jQuery driven).


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.

  • rbuelund
  • rbuelund
  • OFFLINE
  • Posts: 574
  • Thanks: 40
  • Karma: 4
7 years 10 months ago - 7 years 10 months ago #292046 by rbuelund
Replied by rbuelund on topic Gallery with two different templates ?
Actually you just inspired me to a solution ;-) I just wrote my own little jQuery and inserted af radiobutton in the $return string in items.php. That way I can show/hide different parts (classes) of the template.
What i just need now is to show all the fields from a certain profile tab insted of just one field like this:
Code:
$testfield2 = $cbUser->getField( 'cb_logo1description', null, 'html', 'none', 'profile' ) ;

Is it possible to insert all the fields from one certain tab also or will I have to insert each field from that certain tab with the code above ?
Last edit: 7 years 10 months ago by rbuelund.

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

Moderators: beatnantkrileon
Powered by Kunena Forum