News:

Support for jDownloads 3 has been ended
Since 17 August 2023 Joomla.org has discontinued support for Joomla 3.x. Therefore, we will no longer offer official support for our Joomla 3 jDownloads version 3.9.x from January 2024.
Please update your website to the latest Joomla version (Joomla 4 or Joomla 5) as soon as possible. Afterwards, please update jDownloads to the latest published version. The longer you delay, the more difficult the upgrade process for your website is likely to be.

Main Menu
Support-Forum

I made a little hack to filter yours downloads by tags directly in Jdownloads

Started by rikoooo, 13.06.2021 23:58:46

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

rikoooo

Hi,

If someone is interested, I have made a little hack of Jdownloads v3.9 in order to filter your downloads by tags directly from Jdownloads.

OPEN : /components/com_jdownloads/models/downloads.php

Look for this line  :

            $query->from('#__jdownloads_files AS a');
            
Add this code just after :

if(isset($_GET['tag']) && !empty($_GET['tag'])){
        $query->join('INNER', '#__contentitem_tag_map AS t on a.id = t.content_item_id');
        $query->where('(t.tag_id = '.(int)$_GET['tag'].') AND (t.type_alias = \'com_jdownloads.download\')');
}


How it works ? From the 'All Downloads' page, append this argument tag= to your URL
Example : www.exemple.com/downloads/all/?tag=5 (where 5 is your Joomla tag ID).

Now you can create a button link with your favorites tags in your Jdownloads layout.
  •  

ColinM

Rikooo
Sound interesting.  Could you please send a pic of what the output looks like please.
Presently Tags are shown with the Download, if you click on a tag then it lists all the Downloads with that tag using the Tags Component.
Colin
Colin M
  •  

rikoooo

Hi Colin,

The output is the normal outpout of JDownloads, try my hack you will see. (It's not the output of com_tags)

It will output on this page like any other downloads : index.php?option=com_jdownloads&view=downloads

Thank you
  •  

ColinM

Rikoo
Are you saying it effectively turns it into a "list Downloads by Tag"?Colin
Colin M
  •  

rikoooo

Yes absolutely,

It even make the categories obsolete, because now you can use tags instead.
  •  

ColinM

Hi
Will talk with Arno about this as really it would need to be a new option with its own menu item etc. It would be a good addition I think as "List Downloads by Tags"  - Iwill move the topic to 'Suggestions'

Colin
Colin M
  •  

Zoom

This is a really amazing feature. I hope it gets added. Thanks for sharing it!

In the meantime though, is there a way to make an SEF URL and title for each tag page? Otherwise, it's not too great for SEO.
  •  

Super User

Hi Rikoo,
please use never a hack like yours. This would be very dangerous. You should never use unfiltered GET data for a database query!
  •