Please login or register.

Login with username, password and session length
Advanced search  

Author Topic: sitemap() W3C code  (Read 4048 times)

ha100

  • Newbie
  • *
  • Karma: 7
  • Posts: 19
    • ha100
sitemap() W3C code
« on: October 24, 2008, 01:07:49 AM »

if there are no articles and no categories, code at sitemap() is not W3C valid. it is not a big issue (i guess there will always be some articles or categories), but let's make this piece of code completely perfect ;)

in sitemap()

just find first line from snippet, and add red text
Quote
if (mysql_num_rows($cat_result) == 0) {
   echo '<li><p>'.l('no_articles').'</p></li></ul>';
} else {
Logged

Sven

  • ULTIMATE member
  • ******
  • Karma: 88
  • Posts: 2029
  • Chasing MY bugs!
    • hiseo.fr - rédacteur Web
Re: sitemap() W3C code
« Reply #1 on: October 24, 2008, 08:45:34 AM »

if there are no articles and no categories, code at sitemap() is not W3C valid. it is not a big issue (i guess there will always be some articles or categories), but let's make this piece of code completely perfect ;)

in sitemap()

just find first line from snippet, and add red text
Quote
if (mysql_num_rows($cat_result) == 0) {
   echo '<li><p>'.l('no_articles').'</p></li></ul>';
} else {
Hi
I don't see what you mean since my HTML sitemap page does validate with the original code.
More, you should not put a <p> inside an <ul>: it's not semantically correct for the document structure. The <li> tag is a list for items.

funlw65

  • Hero Member
  • *****
  • Karma: 96
  • Posts: 771
    • Country Lab
Re: sitemap() W3C code
« Reply #2 on: October 24, 2008, 11:26:47 AM »

if there are no articles ...

Mr. Sven, except for <p> inside list, he is right ...
Logged

philmoz

  • High flyer
  • ULTIMATE member
  • ******
  • Karma: 161
  • Posts: 1988
    • fiddle 'n fly
Re: sitemap() W3C code
« Reply #3 on: October 24, 2008, 11:46:37 AM »

so
Code: [Select]
echo '<li>'.l('no_articles').'</li></ul>';would be the prefered semantic... yes?
Logged
Of all the things I have lost, it is my mind that I miss the most.

funlw65

  • Hero Member
  • *****
  • Karma: 96
  • Posts: 771
    • Country Lab
Re: sitemap() W3C code
« Reply #4 on: October 24, 2008, 12:11:01 PM »

...  course. :)
Logged

philmoz

  • High flyer
  • ULTIMATE member
  • ******
  • Karma: 161
  • Posts: 1988
    • fiddle 'n fly
Re: sitemap() W3C code
« Reply #5 on: October 31, 2008, 07:57:19 PM »

fixed in final release
Logged
Of all the things I have lost, it is my mind that I miss the most.