Hello,
First I want to express my gratitude for the ease in migrating to J4. I just finished doing all my testing with JD, which I have heavily customized with CSS, and moving to J4 didn't' require much adjustment to the CSS code. Given that J4 has substantially changed it's structure, and all the re-writing I had to do for other extensions, the easy migration for JD is a small miracle. Thank you.
The only customization I do to the code, is to insert a replacement value of {access}, making the layout return the access level for that category and/or file. This helps me immensely given that I'm always adding files about twice monthly, and my tiered membership has access to files basically on how old they are. As an example, regular members have access to files that are over a year old, gold membership has access to all files up to the latest, and a couple more tiers in-between. As this is a "rolling" setup, where every year I change the access levels of some files from gold to regular, files with different ACL sit in the same category. I could use sub-categories, but then when I change them from sub-category the links would change (I use a forum with links to them as extra reminders when they are posted), and a couple other minor issues.
With this new replacement {access} I can "paint" the gold files 'gold' and it also points out to those Gold members what they are getting for their money easily and unmistakably. In the layouts I add something like class="{access}" and I can go to town with CSS.
To achieve this, I've added a line of code to 3 files. There might be need to add more, but this was enough for my needs. With every update, I make these changes again and I thought I'd requested as a new feature as there might be others like me who would want this.
My changes are:
1 ## in file components/com_jdownloads/tmpl/download/default.php
#Add line 489 After: $body = str_replace('{file_title}', $item->title.' '.$editIcon, $body);
New line:
$body = str_replace('{access}', $item->access, $body);
2 ## in file components/com_jdownloads/tmpl/category/default.php
#Add line 1573 After: $html_file = str_replace('{file_title}',$download_link_text, $html_file);
New line:
$html_file = str_replace('{access}', $files[$i]->access, $html_file);
3 ## in file components/com_jdownloads/tmpl/categories/default.php
#Add line 453 after: $html_cat = str_replace('{cat_pic}', $catpic, $html_cat);
New line:
$html_cat = str_replace('{access}', $cats[$i]->access, $html_cat);
I'd be very happy if this would be considered as a new feature to a future upgrade.
Thank you,
Tomás