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

Add Author to Module

Started by tschortsch.de, 22.03.2020 15:18:20

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

tschortsch.de

Hello,
I'd like to add the author to the module jdownloads_latest.
Could you please help me?

Yours Georg
  •  

Tazzios

go to /modules/mod_jdownloads_latest/tmpl
make a duplicate of alternative.php      

add the following code at line 150:

// add the author
$html .= '<div style="padding-bottom: 3px; text-align:'.$date_alignment.';"><small><a href="'.$files[$i]->url_home   .'">' .$files[$i]->author.'</a></small></div>';
         
You can also use url_author but both need to contain the full urls to work so:  'https://google.com'
Go to you module and select the new created layout at the 'Alternative Layout' list.

Tazzios

Maybe it is an idea if the layout function of jdownloads  also would work for the  modules?

tschortsch.de

Quote from: Tazzios on 07.04.2020 16:18:13but both need to contain the full urls to work so:  'https://google.com'
Sorry, but I do not understand that?
Where do I have to insert the url?
  •  

tschortsch.de

Quote from: Tazzios on 07.04.2020 16:43:29
Maybe it is an idea if the layout function of jdownloads  also would work for the  modules?
Yes, that would be great  :)
Can you integrate the code in the module?
  •  

ColinM

Hi
What Tazzios was saying is that when you specify the Author url in the Download it needs to be a full url including the https:// part.Colin
Colin M
  •  

tschortsch.de

#6
Quote from: Tazzios on 07.04.2020 16:18:13
go to /modules/mod_jdownloads_latest/tmpl
make a duplicate of alternative.php      

add the following code at line 150:

// add the author
$html .= '<div style="padding-bottom: 3px; text-align:'.$date_alignment.';"><small><a href="'.$files[$i]->url_home   .'">' .$files[$i]->author.'</a></small></div>';
   
Go to you module and select the new created layout at the 'Alternative Layout' list.      
I tried it that way. But it didn't work.
The author isn't be shown...😥
What is wrong? Could you help me?
  •  

ColinM

HiFirst just in case please make a backup of your site!!!
Please find attached a zip file called alternate-new.zip.  Extract a file called alternate-new.phpCopy the php file to location <your site>\modules\mod_jdownloads_latest\tmpl\You should find a file called alternate.php there already  - if it is not there check which location you are using.
pic Latest-module-01.png shows the results after doing the setup as noted below.
Check that  tab menu assignment is set up to actually show the module! - see Latest-module-02.pngOn tab Advaced select 'alternate-nes'  - see pic Latest-module-03.png
To test add  an author name to one of the latest Downloads  - see pic Latest-module-04.png
Best wishes
Colin
Colin M
  •  

tschortsch.de

Hello Colin, thank you very much. It works ;-)
I made the mistake because I thought that the creator is showing.
But now I replaced the author with creator and it works.
  •