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

Content plugin

Started by heinchrs, 01.05.2021 16:22:52

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

heinchrs

For the content plugin it would be useful to have the possibility to add class attributes for the image display.
The plugin itself displays the filetype image (filepic) without the possibility to define a specific class attribute for the image.

Is it possible to implement this or is there a other way to do this?
  •  

ColinM

Hi
The simple answer is yes!  The plugin uses ,by default, the laouy specified in  Options 'Content Plugin - Default Layout.  Or you can use the "jd_file_onlinelayout=..."Please see articlehttps://www.jdownloads.net/documentation-for-v3-9/modules-plugins-v3-9/using-the-content-plugin-in-articles-and-modules
The layout controls the view in the article.  In most of the standard Download layouts there is a line such as below

Quote<div class="jd_image_right" style="">{screenshot_begin}<a href="{screenshot}" rel="lightbox"><img src="{thumbnail}" style="" /></a>{screenshot_end} </div>
After making a copy of your selected layoutSee articlehttps://www.jdownloads.net/documentation-for-v3-9/layouts-v3-9/layouts-overview-an-introductionYou can then edit the layout to add you own styling directly.  If you want to add classes then these need to be in jdownloads_custom.cssSeehttps://www.jdownloads.net/documentation-for-v3-9/layouts-v3-9/custom-css-in-layouts
If you are unsure please let me know what you are trying to achieve and I will try to help
Colin
Colin M
  •  

heinchrs

Hi,
thanks for your answer, but i have a different problem.

In the content plugin there is a replacement of the token {file_pic}.
My question is, if there is a possibility to adapt the replacement.

In the content plugin file jdownloads.php on line 1490 the following code is executed:
$filepic = '<img src="'.JURI::base().$jDFPsfolders['file'].$files->file_pic.'" align="top" class="nothumb" width="'.$params->get('file_pic_size').'" height="'.$params->get('file_pic_size_height').'" border="0" alt="'.substr($files->file_pic,0,-4).'"/>';

I see no configuration item how this could be changed, so that i can insert a class attribute in the {file_pic} token.

I need this adaption since i have also the image sizer plugin from redim installed.
This this plugin tries to create thumbs for images which have height and width parameters it will create a lightbox for the file type images which i want to prevent by inserting the class="nothumb" .
  •  

ColinM

Hi
I presume you mean a css classIf so what class do you want?
You can of course set the default sizes of the preview images without the need for a separate resizerSee options - Pictures - Specify the size of the preview images (thumbnails).
Colin
Colin M
  •  

heinchrs

Hi,
yes of course you can specify the height and the width, but you can not specify that this attributes do not appear at all.
This is the problem, i have, because the ImageSizer plugin checks if this arguments are present and then manipulate the content.
So therefore it would be good to disable the height and with attributes or introduce a class attribute for the thumbnails.
  •  

ColinM

Hi
You refer to an ImageSizer plugin  - which plugin is that?
The sizing of the files symbol is universal over all jD views so changing the mechanism would have significant implcations.  Presently it is very easy for a user to change the size of the file symbols in the Options.  If it were only controlled by a class then changing the size would not be easy for the majority of people and would need css knowledge.
However if we include a class in the html such as
<img src="http://your site/images/jdownloads/fileimages/flat_1/doc.png" alt="doc" class="jd_filetyp_icon;" width="38" height="38" border="0" align="top">Then you could include the relevant css in the jD Custom css - to override the width and height settings one would need to use the !important in the css.
I have a little work to do on the  content plugin for WCAG compliance to allow support of the Front End Options 'Use Downloads title as download link' and 'Use Link in symbols' so that would be an opportunity.
Colin
Colin M
  •  

ColinM

Hi
I have included a class jd_filetyp_icon  for the file image in the jd conent plugin with the upcoming jD3.9.8 releaseThe I dadded the CSS as below into  jdownloads_custom.css
.jd_filetyp_icon {
  border: 4px solid #ddd !important;
  border-radius: 4px;
  padding: 5px;
  width: 100px !important;
  height: 100px !important;
}
The result is shown in the attached pics
Colin M
  •