trivial patch for matrix them to make html more valid

morgad

Joined: 2007-08-11
Posts: 39
Posted: Sat, 2007-12-01 10:17

Hi,
here is the trivial patch I have made locally to stop the W3C html validator complaining that the html for main.php is not valid.

gallery2/themes/matrix/templates/local# diff -u ../theme.tpl theme.tpl 
--- ../theme.tpl        2006-12-01 21:14:46.000000000 +0000
+++ theme.tpl   2007-11-30 20:57:52.000000000 +0000
@@ -5,7 +5,7 @@
  * version.  Gallery will look for that file first and use it if it exists.
  *}
 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
-<html lang="{g->language}">
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="{g->language}" lang="{g->language}">
   <head>
     {* Let Gallery print out anything it wants to put into the <head> element *}
     {g->head}

it might apply to other themes as well, is it worth applying?

Dave
(now to try and work out how to get the URI's escaped properly, similary to the way URLs are)
--
http://www.morgad.co.uk/gallery2/main.php

 
floridave
floridave's picture

Joined: 2003-12-22
Posts: 25940
Posted: Sat, 2007-12-01 17:41

Thanks for that.
Please add patches here as well:
http://sourceforge.net/tracker/?group_id=7130&atid=307130
they are racked a bit better than the forums.

Dave
_____________________________________________
Blog & G2 || floridave - Gallery Team

 
valiant

Joined: 2003-01-04
Posts: 32509
Posted: Sat, 2007-12-01 17:57

the svn version has the xmlns attribute already.
please always consult the svn version before reprting bugs / filing patches.
thanks.

--------------
Documentation: Support / Troubleshooting | Installation, Upgrade, Configuration and Usage

 
flami
flami's picture

Joined: 2007-07-01
Posts: 8
Posted: Sun, 2007-12-02 00:59

well I made a little fix too :

*** gallery/themes/matrix/templates/album.tpl   2007-01-12 23:05:05.000000000 +0                        100
--- album.tpl   2007-12-02 01:50:37.000000000 +0100
***************
*** 9,15 ****
      {if !empty($theme.params.sidebarBlocks)}
      <td id="gsSidebarCol">
        {g->theme include="sidebar.tpl"}
-     </td>
      <script type="text/javascript">
        {* hide the sidebar if there's nothing in it *}
        // <![CDATA[
--- 9,14 ----
***************
*** 19,24 ****
--- 18,24 ----
        if (!text || !text.match(/\S/)) el.style.display = 'none';
        // ]]>
      </script>
+     </td>
      {/if}
      <td>
        <div id="gsContent" class="gcBorder1">

I hope I dont break anything :P

this fixes :
Line 84, Column 30: document type does not allow element "script" here; missing one of "th", "td" start-tag .
<script type="text/javascript">

 
valiant

Joined: 2003-01-04
Posts: 32509
Posted: Sun, 2007-12-02 10:23

if i remember correctly, this one's fixed since half a year too.
please check nightly snapshots / the svn version before ...
see above. :)

thanks.

--------------
Documentation: Support / Troubleshooting | Installation, Upgrade, Configuration and Usage

 
flami
flami's picture

Joined: 2007-07-01
Posts: 8
Posted: Sun, 2007-12-02 11:38

jebus why didnt that make it into the latest stable release ? I mean half a year ^^.

aparently its been fixed :

revision 16349, Wed Apr 25 22:36:13 2007 UTC
Bug 1706509: [G2] Doesn't validate as XHTML 1.0

Move the sidebar collapse <script> tag into the subsequent <td>
element so that it's legal XHTML 1.0. This still looks fine on FF2
and IE6. Review #232.

...
wooo 7 months ?

 
valiant

Joined: 2003-01-04
Posts: 32509
Posted: Sun, 2007-12-02 11:35

2.2 is from April. this has been discovered and fixed shortly after that.
see: http://fisheye3.cenqua.com/browse/gallery/trunk/gallery2/themes/matrix/templates/album.tpl?r1=16235&r2=16349

it's not a critical issue and thus has not been part of any of the security / stability releases since (2.2.1-2.2.3).

--------------
Documentation: Support / Troubleshooting | Installation, Upgrade, Configuration and Usage

 
floridave
floridave's picture

Joined: 2003-12-22
Posts: 25940
Posted: Mon, 2007-12-03 02:26
flami wrote:
jebus why didnt that make it into the latest stable release ? I mean half a year ^^.

valiant wrote:
it's not a critical issue and thus has not been part of any of the security / stability releases since (2.2.1-2.2.3).

So, that means you will see it in G2.3.

Dave
_____________________________________________
Blog & G2 || floridave - Gallery Team

 
flami
flami's picture

Joined: 2007-07-01
Posts: 8
Posted: Mon, 2007-12-03 19:00

hehe , aparently i was writing my post while i got the answer ^^.
thanks for the quick reply