jDownloads Support Forum

Older Versions => jDownloads 3.2 (Support ended) => Bugs => Topic started by: schmatzler on 17.04.2015 17:57:53

Title: W3C Validator errors in default layouts and modules
Post by: schmatzler on 17.04.2015 17:57:53
JDownloads keeps some old code that is not being used in browsers anymore. I'd like to have XHTML valid code, so I had to change a lot of things.

Specifically, the W3C validator complains about attributes like width, height, border etc. that could be done in CSS but are specified directly in the elements.

An example is mod_jdownloads_latest, alternate.php:

$files_pic = '<img src="'.JURI::base().'images/jdownloads/fileimages/'.$files[$i]->file_pic.'" align="top" width="'.$size.'" height="'.$size.'" border="0" alt="" /> ';
to:
$files_pic = '<img src="'.JURI::base().'images/jdownloads/fileimages/'.$files[$i]->file_pic.'" width="'.$size.'" height="'.$size.'" alt="" /> ';

align and border are obsolete in img tags. In fact, align isn't being used at all anymore by new browsers and simply ignored. text-align is somewhat a replacement.

It works but could really be worked over, at least the modules since their design can't be altered without hacking around in the .php files.
Currently I get about a hundred validation errors just on the downloads page.

Edit: One big step would be converting things like these:

<tr valign="top" border="0px">
into this:

<tr style="vertical-align:top; border=0px;">
or even better:

<tr class="whateverthisis">
and the according CSS for that.
Title: Re: W3C Validator errors in default layouts and modules
Post by: ColinM on 17.04.2015 19:42:53
Hi
Thank you for your comments. We are aware of the challenges here but our priority was to get a stable version of jD for the thousands of people who needed to move to a scheme  that was fully compliant with Joomla! 3.x

As you are obviously well aware many of the html attributes are deprecated and it would be nice to eliminate them.  This is work in  hand for another major release.  Of particular importance is the use of layouts with simple and easily changed html.  Most of those will have css classes added together with inline style.  A few purists may look down on inline style but it is actually easier for the more novice user to tailor their output by using in line.

One significant step in the general direction has been the introduction of a jdownloads_custom.css file that is loaded last.  This allows overriding the jdownloads_fe.css without having to redo each time.

You make specific mention of Modules, and yes they might be simpler to bring up to a better level because they are more compact and there is a lower potential of side effects.  The main pressures on us are to get all the previously available modules and plugins back working.

In the example you picked out another way would be
$files_pic = '<img src="'.JURI::base().'images/jdownloads/fileimages/'.$files[$i]->file_pic.'" width="'.$size.'" height="'.$size.'style="border: 0px; vertical-align: top;"'.'" alt="" /> ';

or better as
$files_pic = '<img src="'.JURI::base().'images/jdownloads/fileimages/'.$files[$i]->file_pic.'" width="'.$size.'" height="'.$size.' class="jd_latest_bord0_vert" '.'" alt="" /> ';

What would be really, really helpful would be some assistance in doing the work!!  Any offers more than welcome.

Colin
Title: Re: W3C Validator errors in default layouts and modules
Post by: schmatzler on 18.04.2015 00:07:21
Quote from: ColinM on 17.04.2015 19:42:53
What would be really, really helpful would be some assistance in doing the work!!  Any offers more than welcome.

I went through the modules and core-files and have rewritten all the sections where the W3C parser was complaining. My patches are up here:

https://github.com/schmatzler/jdownloads_w3c/commits/master

I didn't change the default layouts that can be edited in the backend since I use my own, but it should be fairly simple to do that, too. :)

No JDownloads-related errors anymore (the two errors come from Kunena):

http://validator.w3.org/check?uri=http%3A%2F%2Fwww.i-war2.com%2Fdownloads&charset=%28detect+automatically%29&doctype=Inline&group=0&user-agent=W3C_Validator%2F1.3+http%3A%2F%2Fvalidator.w3.org%2Fservices
Title: Re: W3C Validator errors in default layouts and modules
Post by: ColinM on 18.04.2015 10:00:48
Hi
That's brilliant. Thank you. I will point Arno at the the work you have done.
Colin
Title: Re: W3C Validator errors in default layouts and modules
Post by: Arno on 19.04.2015 14:26:06
@schmatzler:
many thanks for your corrections. I know that some parts which comes from the older series must be updated in the newer source code.
So i will use your work in next version 3.2.32  ;D 8)
Title: Re: W3C Validator errors in default layouts and modules
Post by: schmatzler on 19.04.2015 15:07:04
Awesome, thanks! :-)

When I have time, I'll try to make the plugins and the default layouts compatible, too. But it will take a while, since I'm pretty busy at the moment. :(
Title: Re: W3C Validator errors in default layouts and modules
Post by: Arno on 25.04.2015 12:03:11
I hope you will find the time to do it.  ;D
Title: Re: W3C Validator errors in default layouts and modules
Post by: schmatzler on 03.08.2015 17:08:50
I've switched to the last_downloaded module and realized, that it was still not W3C valid.

So I did that:

https://github.com/schmatzler/jdownloads_w3c/commit/43f6b8d0b27dbabb39369f30dc1a1efe86c04d11

Please put it into the next release, too :)
Title: Re: W3C Validator errors in default layouts and modules
Post by: Arno on 05.08.2015 20:15:36
Is done. Thanks again. ;)