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!

[SOLVED] Gallery with direct download links ?

  • rbuelund
  • rbuelund
  • OFFLINE
  • Posts: 574
  • Thanks: 40
  • Karma: 4
7 years 10 months ago - 7 years 10 months ago #292247 by rbuelund
I need to be able to have direct download links in the gallery instead of link to the preview of the item (image or file):
I have this line in the item_container.php:
Code:
$embed = cbTooltip( null, '', null, array( '90%', '90%' ), null, CBTxT::T('Download'), 'javascript: void(0);', 'class="galleryItemEmbed" data-cbtooltip-modal="true" data-cbtooltip-open-solo="document" data-cbtooltip-classes="galleryModal" data-cbgallery-url="' . $displayPath . '" data-cbgallery-request="' . htmlspecialchars( json_encode( $data ) ) . '"' );

Can I change something here so that the "Download" text is the direct link to the file ?
Last edit: 7 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: 48709
  • Thanks: 8319
  • Karma: 1447
7 years 10 months ago #292255 by krileon
Replied by krileon on topic Gallery with direct download links ?
The download link already downloads the image. It forces an attachment output, which is a download and not an inline preview. You can find it on the menu of an image when viewing the modal. If it's not there then ensure Download is enabled for Photos within CB Gallery > Parameters > Photos > Display (this enables it globally and assumes you did not turn it off on a per gallery usage).




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.
Attachments:

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 #292261 by rbuelund
Replied by rbuelund on topic Gallery with direct download links ?
Well - yes, but that is not it - when I press the "Download" as it is now, a modal opens with the image or the file - I do not want that modal to open - i want a windows download dialog to open - is that possible ?

- At the same time I would like to be able to still get the little edit icon next to the "Download" link, when logged in. The "Download" link I am refering to is the one generated from the code-line in the earlier post.
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 - 7 years 10 months ago #292280 by rbuelund
Replied by rbuelund on topic Gallery with direct download links ?
Any idea ?

I have sent you a PM
Last edit: 7 years 10 months ago by rbuelund.

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 #292287 by krileon
Replied by krileon on topic Gallery with direct download links ?
Ok, so you want a download button outside of the modal window. That's just a matter of outputting that URL, which can be done as follows.

Code:
$downloadURL = $_CB_framework->pluginClassUrl( $plugin->element, true, array( 'action' => 'item', 'func' => 'download', 'id' => $row->get( 'id', 0, GetterInterface::INT ), 'gallery' => $gallery->id() ), 'raw', 0, true );

That should work fine if directly added to item_container.php template file which appears to be the template file you're adjusting.


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 #292295 by rbuelund
Replied by rbuelund on topic Gallery with direct download links ?
Wau! - so simple - so perfect ! Thank you very much :-)
The following user(s) said Thank You: krileon

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

Moderators: beatnantkrileon
Powered by Kunena Forum