jDownloadsownloads.com

Advertisement
Advertisement:

Author Topic: Display Jdownloads file title Inline in Text  (Read 643 times)

0 Members and 1 Guest are viewing this topic.

Offline cwarder

  • Newbie
  • *
  • Posts: 2
Display Jdownloads file title Inline in Text
« on: 26.05.2016 22:27:33 »
Hi. I am using Jdownloads 3.2.41. I am using the content plugin. The jdownload files are displayed correctly in the content. My customer wants to be able to add a jdownload file in a paragraph so that it is display: inline. I changed the jd_content class to display:inline. I also created a new file layout with just the file title. When I look at the content, a <p></p> is put above and below the file. I looked at the layout and nothing is there except {file_title}. How can I get rid of the <p></p> before and after the div class jd_content?

Offline ColinM

  • Moderator
  • *
  • Posts: 3.032
Re: Display Jdownloads file title Inline in Text
« Reply #1 on: 26.05.2016 23:15:18 »
Hi
You first need to update to jD v44.  There are a new set of layouts, one of which is "Files link only v3.2".  However this will need some extra css in jd_custom.css
Code: [Select]
/*  section for Content Plugin - title only  */
.jd_content_plugin{
 float:none;
 display:inline-block;
 clear:none;
}

This css will be part of the next release.    Note the class .jd_content_plugin has been introduced for aid in customising the plugin appearance.

Colin

Offline alfeltrin

  • Newbie
  • *
  • Posts: 1
Re: Display Jdownloads file title Inline in Text
« Reply #2 on: 22.06.2016 11:16:22 »
After you have added a div wrapp i have problems to display a link inline inside a paragraph

This is my code:
<p>
File A: {jd_file file==1}<br />
File B: {jd_file file==2}
</p>

And this is the html generated:
<p>File A:</p>
<div jDownload....></div>

A solution may be to have the possibility to choose to enable/disable the wrapper

Offline ColinM

  • Moderator
  • *
  • Posts: 3.032
Re: Display Jdownloads file title Inline in Text
« Reply #3 on: 22.06.2016 14:16:33 »
Hi
This is an Editor mode problem.  Basically HTML does not 'allow' or support a <div> inside a <p> (actually it is 'undefined' as to what happens). The Editor 'corrects' your code!

So set your editor to its <div> mode Editors such as JCE, JCK are usually defaulted to Paragraph mode.

So your code should look like below NB the <br> has also been removed.
Code: [Select]
<div>
File A: {jd_file file==1}
File B: {jd_file file==2}
</div>
and it must not be inside a <p> element.

Attached are 3 pics which show the result when using editor in <div> mode

There are numerous web references to having <div> inside <p> with explanations why it is not 'allowed'. <p> is a block element Basically the specification  http://www.w3.org/TR/html401/struct/text.html#h-9.3.1,  says that the P element "cannot contain block-level elements (including P itself)".

The <div> element is also a block element but its main purpose is for grouping other block elements.

Think I need to add to the documentation.  And Yes I have made the same mistake!!

Colin

 

Advertisement