Where can I edit the code for the download button?
<div class="jd_title_right jd_download_url_position" style=""><a href="" class="jdbutton jorange ">Download</a></div>
Can I override it with my template?
HiThe buttons are entirely cenerated by css.
If you go to Layouts and select css you can see what styling is used in the front end and also what is used for styling the button. Any overriding css can be put in jdownloads_custom.css. All the css used by jD includes the prefix jd_ to minimise clashes. As the custom css is loaded last it overrides any other css except for the direct styling in the layouts, but the layouts can be modified anyway. There is some documentation in
http://www.jdownloads.net/documentations/category/layouts
Colin
Thanks, but I'd like to add my own classes to automatically get the same styles of my template, instead of duplicate them
Where is that code located? I couldn't find it under /components/com_jdownloads/views/download/tmpl/default.php
Hi
This is not as straight forward as you may think as jD has many possibilities.Here I suppose you are trying to modify the Download button that appears in the list of Downloads.You could of course opt to have no button and to use the title as a link which avoids the problem.
There is not just one item of code concered as you could be showing a list of Downloads or you could be showing the Download Details view
In the Downloads list the generated code is like
<div class="jd_download_url jd_download_url_position" style=""> <a target="_blank" href="link details" title="Download" class="jdbutton jorange jsmall">Download</a></div>
This code is generated from two sources. One of these is the active Downloads layout and the other is file
\components\com_jdownloads\views\downloads\tmpl\default.php
The layout part is straight forward. In the files layout there will be a line like
<div class="jd_download_url jd_download_url_position" style="">{url_download}</div>
You could change those but they are only concerned with the actual link and the positioon of the link.
The button styling css is the part class="jdbutton jorange jsmall".This is generated at around line 966 which is
$download_link_text = '<a '.$blank_window.' href="'.$download_link.'" title="'.JText::_('COM_JDOWNLOADS_LINKTEXT_DOWNLOAD_URL').'" class="jdbutton '.$download_color.' '.$download_size_listings.'">';
so that could be overriden by an default.php file that contained
$download_link_text = '<a '.$blank_window.' href="'.$download_link.'" title="'.JText::_('COM_JDOWNLOADS_LINKTEXT_DOWNLOAD_URL').'" class="your_css_class">';
There is a similar section in the Downloads details file
\components\com_jdownloads\views\download\tmpl\default.php at around line 692
In both php files there is a reference to 'old button style'. This is no longer used and will not be supported in the next major release.
Hope this helps - but much easier to repeat the css. Note we are currently working on a new major release of jD where the php files may be different but the classes used for the buttons will remain
ColinPS I forgot about the Summary view\components\com_jdownloads\views\summary\tmpl\default.php at around line 640
Thanks, I found the code and put a default.php under [template]/html/com_jdownloads/download
But it's not overriding... I want to style a direct download link, maybe the code is in a different position?
Hi
I am not familiar with Component overides and I think perhaps you may have put the default.php file in the wrong place. From what little I know I believe Component overrides are quite different from Jooma! core overrides.
Note that in common with Joomla! there are many default.php files used in jD, all from different directory locations.Really think for initial puposes you should try a css solution. Then you have something to check against.
Colin
Nope, it doesn't change even editing directly the core view files under /download and /downloads, it must be somewhere else
This is the code I'm getting in frontend, using a direct download link on file title:
<div class="jd_content jd_content_plugin jd_content_file"><a href=".." title="Download" class="jd_download_url">Forma LMS 2.2.1</a> </div>
Any suggestion?
Ok found it, it was under:
/plugins/content/jdownloads/jdownloads.php
don't think this can be overridden, but ok for now
Hi
Did not appreciate you are using the Content PluginThe Content plugin will be using a layout as set in Config - Plugins You could create your own layout
Colin