XHTML Strict invalid #34

Closed
vinny opened this Issue Jan 4, 2012 · 27 comments

Comments

Projects
None yet
3 participants
Contributor

vinny commented Jan 4, 2012

I'm testing the mod and there are lots XHTML errors. As you want submit in next days at MODDB, I'll propose a fix as fast as possible.

Contributor

michaelcullum commented Jan 4, 2012

Ah thanks for pointing that out. I hadn't checked for XHTML or CSS Validation.

I'll hold the 1.0.0 release.

Thanks again. :)

Contributor

michaelcullum commented Jan 4, 2012

By a lot I thought you meant 10 or so. 230 errors for just post article, blog home and view blog entry. Looks like no release for at least a couple of days.

I seriously owe you a favour for this.

@imkingdavid sighs

Member

imkingdavid commented Jan 4, 2012

Hey, this is old code, when I sucked at writing HTML. ;)

Contributor

michaelcullum commented Jan 4, 2012

I'll post the release once this is done.

Contributor

vinny commented Jan 5, 2012

Part1: vinny/phpBB-Blog@816b8dd
Part2: vinny/phpBB-Blog@006fd34

Status:
blog home = ok + 1 error
view article = ok + 1 error
Edit Comment = OK
Edit article = 4~5 errors + 1 error
View Cat = ok + 1 error
View Tag = ok + 1 error

This 1 error on blog home, view article, Edit article, view cat/tag is because the CSS inserted into the blog_index_body.html. I recommend inserting it in a new CSS file and include on the overall_header.html by
<* link href="{T_THEME_PATH}/blog.css" rel="stylesheet" type="text/css" media="screen" */>.

I think that part 3 will be the last. Do you recommend anything about the CSS above?

Contributor

michaelcullum commented Jan 5, 2012

Go ahead. What are the 4~5 errors on edit article?

And did you see my comment about me merging part one and two now using the fork queue?

Thank you.

Contributor

vinny commented Jan 5, 2012

The errors are because some inputs use the same ID.

I think is better to merge when it's all fixed.

So, what do you think about the new CSS file. Will need to enter via overall_header.htmt in install.xml

Contributor

michaelcullum commented Jan 5, 2012

hm... Looks like we haven't got much choice to be honest as it needs to be XHTML valid to get validated. Unless we put the blog on a completely different header template from the rest of the site?

Contributor

michaelcullum commented Jan 5, 2012

Although we do already have 1 edit in overall_header.html already for the link to the blog.

Contributor

michaelcullum commented Jan 5, 2012

Just to check, are they warnings or errors?

Contributor

vinny commented Jan 5, 2012

Both.

The "+ 1 error" in all pages is:

Error Line 155, Column 23: document type does not allow element "style" here

<style type="text/css">

The element named above was found in a context where it is not allowed. This could mean that you have incorrectly nested elements -- such as a "style" element in the "body" section instead of inside "head" -- or two elements that overlap (which is not allowed).

One common cause for this error is the use of XHTML syntax in HTML documents. Due to HTML's rules of implicitly closed elements, this error can create cascading effects. For instance, using XHTML's "self-closing" tags for "meta" and "link" in the "head" section of a HTML document may cause the parser to infer the end of the "head" section and the beginning of the "body" section (where "link" and "meta" are not allowed; hence the reported error).

It is the CSS that needs to be moved to <* head> .... </*head>

"Edit article = 4~5 errors"
Are in fact 3 Errors and 5 warnings.

Error Line 160, Column 56: there is no attribute "name"

<form action="blog.php?action=edit_blog&amp;id=2" name="postform" method="post">



You have used the attribute named above in your document, but the document type you are using does not support that attribute for this element. This error is often caused by incorrect use of the "Strict" document type with a document that uses frames (e.g. you must use the "Transitional" document type to get the "target" attribute), or by using vendor proprietary extensions such as "marginheight" (this is usually fixed by using CSS to achieve the desired effect instead).

This error may also result if the element itself is not supported in the document type you are using, as an undefined element will have no supported attributes; in this case, see the element-undefined error message for further information.

How to fix: check the spelling and case of the element and attribute, (Remember XHTML is all lower-case) and/or check that they are both allowed in the chosen document type, and/or use CSS instead of this attribute. If you received this error when using the <embed> element to incorporate flash media in a Web page, see the FAQ item on valid flash.
Error Line 171, Column 44: ID "subject" already defined

…dd><input type="text" name="desc" id="subject" size="45" maxlength="64" tabind…



An "id" is a unique identifier. Each time this attribute is used in a document it must have a different value. If you are using this attribute as a hook for style sheets it may be more appropriate to use classes (which group elements) than id (which are used to identify exactly one element).
Info Line 167, Column 45: ID "subject" first defined here

…d><input type="text" name="title" id="subject" size="45" maxlength="64" tabind…

Error Line 345, Column 44: ID "subject" already defined

…dd><input type="text" name="tags" id="subject" size="60" maxlength="255" tabin…



An "id" is a unique identifier. Each time this attribute is used in a document it must have a different value. If you are using this attribute as a hook for style sheets it may be more appropriate to use classes (which group elements) than id (which are used to identify exactly one element).
Info Line 167, Column 45: ID "subject" first defined here

…d><input type="text" name="title" id="subject" size="45" maxlength="64" tabind…

Warning Line 166, Column 21: reference to non-existent ID "title"

                <dt><label for="title">Blog Title:</label></dt>



This error can be triggered by:
    A non-existent input, select or textarea element
    A missing id attribute
    A typographical error in the id attribute

Try to check the spelling and case of the id you are referring to.
Warning Line 344, Column 21: reference to non-existent ID "tags"

                <dt><label for="tags">Blog Tags:<br /></label><em>Separate each entry with …



This error can be triggered by:
    A non-existent input, select or textarea element
    A missing id attribute
    A typographical error in the id attribute

Try to check the spelling and case of the id you are referring to.
Warning Line 340, Column 21: reference to non-existent ID "allow_cmnt"

                <dt><label for="allow_cmnt">Allow users to post comments:</label></dt>



This error can be triggered by:
    A non-existent input, select or textarea element
    A missing id attribute
    A typographical error in the id attribute

Try to check the spelling and case of the id you are referring to.
Warning Line 175, Column 21: reference to non-existent ID "cat_id"

                <dt><label for="cat_id">Category:</label></dt>



This error can be triggered by:
    A non-existent input, select or textarea element
    A missing id attribute
    A typographical error in the id attribute

Try to check the spelling and case of the id you are referring to.
Warning Line 170, Column 21: reference to non-existent ID "desc"

                <dt><label for="desc">Description:</label></dt>



This error can be triggered by:
    A non-existent input, select or textarea element
    A missing id attribute
    A typographical error in the id attribute

Try to check the spelling and case of the id you are referring to.
Contributor

michaelcullum commented Jan 5, 2012

Your opinion, new header file for blog or overall_header.html edit and make it a 2 edit MOD?

Contributor

vinny commented Jan 5, 2012

To be honest, I think better to create a new CSS file to move the code and edit the overall_header.html to add something like:

<! IF BLOG_ENABLE -->
<* link href="{T_THEME_PATH}/blog.css" rel="stylesheet" type="text/css" media="screen" />.
<
!-- ENDIF --*>

Contributor

michaelcullum commented Jan 5, 2012

hm... Ok then, do you want to include that in part 3 then?

Contributor

vinny commented Jan 5, 2012

What do you think? What is your opinion?

I have corrected the other errors, missing only the CSS.

Contributor

michaelcullum commented Jan 5, 2012

I'm not sure. I would like to keep it as few edits as possible but we already edit overall_header.html so its not like opening a second file. Its not a big edit and I suppose this keeps better compatibility with custom styles.

Contributor

vinny commented Jan 5, 2012

So, I do the following: I will send the last part and submit the PR, already fixed all errors only missing CSS.

You decided the best solution to the CSS. :D

Contributor

michaelcullum commented Jan 5, 2012

Thanks. I'll merge the PR then go to bed as its 1:44 and I only stayed up to get this baby finished and released for MODs in Dev Forum tonight.

Contributor

vinny commented Jan 5, 2012

Contributor

michaelcullum commented Jan 5, 2012

Do you want to do the CSS etc. or shall I?

Contributor

vinny commented Jan 5, 2012

I'm also go to bed. If you dont do, I do later, but tell me how you prefer.

And if you need more help with HTML-CSS let me know.

Contributor

michaelcullum commented Jan 5, 2012

If you could it would be greatly appreciated as you know what code needs moving.

Contributor

vinny commented Jan 6, 2012

Okay. How do you prefer to call the CSS file? blog.css or phpbb_blog.css or another name?

Prefer any line in overall_header.html?

And what is the variable that checks if the blog is active?

Contributor

michaelcullum commented Jan 6, 2012

You've seen more custom styles than I have Marcus. A line with a find less likely to be changed in a custom style. ;)

blog.css please

Erm, good question. BLOG_ENABLED_C now. But I only just committed it so you'll need to merge from the repo.

Contributor

vinny commented Jan 6, 2012

Contributor

michaelcullum commented Jan 6, 2012

Looks good. Submit a PR and I'll merge it.

Contributor

michaelcullum commented Jan 6, 2012

Merged

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment