jDownloads for Joomla 3.x => jDownloads 3.9 => Suggestions - Feature Request => Topic started by: heinchrs on 01.05.2021 16:22:52

Title: Content plugin
Post by: heinchrs on 01.05.2021 16:22:52
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?
Title: Re: Content plugin
Post by: ColinM on 02.05.2021 15:03:26
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 article
The layout controls the view in the article.  In most of the standard Download layouts there is a line such as below

<div class="jd_image_right" style="">{screenshot_begin}<a href="{screenshot}" rel="lightbox"><img src="{thumbnail}" style="" />[/url]{screenshot_end} </div>
After making a copy of your selected layoutSee article 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.cssSee
If you are unsure please let me know what you are trying to achieve and I will try to help
Title: Re: Content plugin
Post by: heinchrs on 02.05.2021 21:29:30
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:
Code: [Select]
$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" .
Title: Re: Content plugin
Post by: ColinM on 03.05.2021 17:34:44
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).
Title: Re: Content plugin
Post by: heinchrs on 09.05.2021 08:35:38
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.
Title: Re: Content plugin
Post by: ColinM on 15.05.2021 14:41:27
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.
Title: Re: Content plugin
Post by: ColinM on 18.05.2021 12:05:12
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
Code: [Select]
.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