jDownloads Support Forum

Older Versions => jDownloads 3.2 (Support ended) => General => Topic started by: Bridge211 on 18.06.2015 17:25:59

Title: Limiting characters in title/Not breaking downloads layout
Post by: Bridge211 on 18.06.2015 17:25:59
Hello,

Whenever a title is too long, it "breaks" the layout, as in the image attached.

Is there a way to solve this please?

[gelöscht durch Administrator]
Title: Re: Limiting characters in title/Not breaking downloads layout
Post by: Bridge211 on 23.06.2015 19:20:09
Any help please?
Title: Re: Limiting characters in title/Not breaking downloads layout
Post by: ColinM on 24.06.2015 06:51:02
Hi
First apologies for missing the initial post.  Yes there are ways to sort this out. 


One suitable way is to re-organise the layout to handle long names.  In the layout you are using it seems you have all the 'items' in a single row.  Think you have perhaps modified one of the existing layouts and left out the width of the <td> element that encloses the file name placeholder.

It would probably be better to re-organise all the items you want to show in more than one line.  The code below is not exact in the second rowbut is illustrative.  Also if the file name is too long for one line it will automatically expand to more lines, but of the same width.

<table style="padding: 3px; background-color: #f5f5f5; width: 100%;">
<tbody>
<tr valign="middle">
<td width="5%">{file_pic} </td>
<td width="80%">{file_title}</td>
<td width="10%">
<p align="center">{url_download}</p>
</td>
</tr>
<tr valign="middle">
<td width="??%">place-holders in {} </td><td width="??%"> more place-holders in {} </td>
</tbody>
</table>


To go any further I would need a copy of the main body of your existing layout and an indication of what you would like where.

Colin
Title: Re: Limiting characters in title/Not breaking downloads layout
Post by: Bridge211 on 25.06.2015 08:44:31
Hi,

Thank you very much.
Here is my current code:

<p>{files_title_begin}</p>

<div style="background-color:#f5f5f5; padding:6px;">{files_title_text}</div>

<p>{files_title_end}</p>

<table style="padding:3px; background-color:#f5f5f5;" width="100%">
<tbody>
<tr valign="middle">
<td style="width: 388px;" width="55%">&nbsp;</td>
<td style="width: 42px;" width="20%">
<p align="center">&nbsp;</p>
</td>
<td width="20%">{file_pic} {file_title} {release} {pic_is_new} {pic_is_hot} {pic_is_updated}</td>
<td width="20%">
<p align="center">{created_date_value}</p>
</td>
<td width="20%">
<p align="center">Téléchargements:&nbsp;{hits_value}</p>
</td>
<td width="20%">
<p align="center">{url_download}</p>
</td>
<td width="25%">
<p align="center">{rating}</p>
</td>
<td width="25%">
<p align="center">{report_link}</p>
</td>
</tr>
<tr>
</tr>
</tbody>
</table>


What I would like is to have the essential information (as displayed in the screenshot) on a single line. I guess the only modification to adapt would be to have the title on a line above the others, or simply have it expand to other lines.
Title: Re: Limiting characters in title/Not breaking downloads layout
Post by: ColinM on 26.06.2015 21:37:14
Hi Bridge211
Yes your layout code will cause some confusion.  Please see pic below for final look.  Have made it a 3 line layout with third line for tags, in no tags then it will not show'
  If the name is very long it will wrap around to give an extra line.  But with the icon separately centered

{files_title_begin}<div style="background-color:#EFEFEF; padding:6px;">{files_title_text}</div>{files_title_end}

<table width="100%" style="padding:3px; background-color:#F5F5F5;">
   <tr valign="middle">
      <td width="5%">{file_pic} </td>
      <td width="50%"> {file_title} {release} {pic_is_new} {pic_is_hot} {pic_is_updated}</td>
      <td width="10%"><p align="center">{rating}</p></td>
      <td width="15%"> <p align="center">{url_download}</p></td>
      <td width="10%">{report_link}</td>
   </tr>
   <tr>
          <td width="5%"></td>
         <td width="20%">
                   <p align="left">{created_date_title}:&nbsp;{created_date_value}</p>
  </td>
  <td width="20%">
                  <p align="left">{hits_title}:&nbsp;{hits_value}</p>
  </td>
        <td width="20%">
           <p align="center">{filesize_title}:&nbsp;{filesize_value}</p>
</td>

</tr>
   <tr> <td width="5%"></td><td>{tags}</td></tr>
</table>
<table width="100%" style="padding:3px;">   
   <tr>
      <td width="75%" align="left" valign="top">{description}<br />{mp3_player}<br />{mp3_id3_tag}</td>
      <td valign="top">{screenshot_begin}<a href="{screenshot}" rel="lightbox"> <img src="{thumbnail}" align="right" /></a>{screenshot_end}
      </td>
   </tr>
</table>


I have also left in the description and so  on in the second table, which you could remove
Please let me have any comments or other refinements
Colin

[gelöscht durch Administrator]
Title: Re: Limiting characters in title/Not breaking downloads layout
Post by: Bridge211 on 28.06.2015 22:59:02
It's great! Thank you very much! I would just like to display the uploader's name too, somewhere near the file name, wherever you think it is more convenient.

Thanks a lot!
Title: Re: Limiting characters in title/Not breaking downloads layout
Post by: ColinM on 28.06.2015 23:44:13
Hi
Glad it worked OK.  For the creator name how about following the Created Date so it reads Created <date> by <creator>  ?

Colin
Title: Re: Limiting characters in title/Not breaking downloads layout
Post by: Bridge211 on 11.07.2015 13:39:37
Good idea, I'll do that