Page 1 of 1

Module: Uploads manager

Posted: Fri Aug 17, 2018 11:55 am
by blackrain
I am using version 1.25.8 of the Uploads module and was wondering how to display the category name of the file list. I can see how its done in the details view but not the summary view.

Many thanks

Mark

Re: Module: Uploads manager

Posted: Fri Aug 17, 2018 1:52 pm
by Rolf
A few years ago I made a website where I needed this too. As far as I remember I could not find a available feature back then... So I created a UDT. Perhaps in the year 2018 there is a better way, but if not here my solution.

User Defined Tag, named uploads_category_name

Code: Select all

$id = isset($params['id']) ? $params['id'] : '';
                
$db = cmsms()->GetDb();
$query = 'SELECT upload_category_name FROM '.cms_db_prefix().'module_uploads_categories WHERE upload_category_id='.$id;

$result = $db->Execute($query);
if ($result) { echo $result->Fields('upload_category_name'); }
In the template I use:

Code: Select all

{uploads_category_name id=$entry->category}