-
-
Notifications
You must be signed in to change notification settings - Fork 3.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Convert all remaining templates to HTML5 #9842
Conversation
Are beez and hathor really HTML5 templates? I don't know myself. |
beez3just check the generated HTML code of the first page. You can see footer, section HTML tags that are exclusive HTML5. So this really fixes a bug. Also checked the frontpage generated HTML code after this PR in the W3C validator and the only errors i got are regarding the CSS hathorI think it was not build as an HTML5 template, but in the generate code across the backend exist some HTML5 features ( Also checked the control panel generated HTML code after this PR in the W3C validator and just got 1 error: I also plan to put html5.js for older IE versions. |
|
@@ -25,7 +28,7 @@ | |||
<?php if ($this->direction == 'rtl') : ?> | |||
<link href="<?php echo $this->baseurl; ?>/templates/<?php echo $this->template; ?>/css/template_rtl.css" rel="stylesheet" type="text/css" /> | |||
<?php endif; ?> | |||
|
|||
<!--[if lt IE 9]><script src="<?php echo $this->baseurl; ?>/media/jui/js/html5.js"></script><![endif]--> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why is this removed?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
removed? it was added a missing html5.js
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I need more coffee
$doc->addStyleSheet($this->baseurl . '/templates/' . $this->template . '/css/template.css', $type = 'text/css', $media = 'screen,projection'); | ||
$doc->addStyleSheet($this->baseurl . '/templates/' . $this->template . '/css/position.css', $type = 'text/css', $media = 'screen,projection'); | ||
$doc->addStyleSheet($this->baseurl . '/templates/' . $this->template . '/css/layout.css', $type = 'text/css', $media = 'screen,projection'); | ||
$doc->addStyleSheet($this->baseurl . '/templates/' . $this->template . '/css/template.css', $type = 'text/css', $media = 'screen'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why is projection removed?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
because the W3C validator said that media=projection is deprecated in html5.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OK thanks - found this link http://stackoverflow.com/questions/31410984/link-tag-media-attribute-projection-tv-not-valid so that satisfies my enquiry
Other than reducing th file size by a few bytes is there any benefit to these changes |
The few bytes reduced are not relevant to the case. The benefits? Aside that, with the creation of HTML5, XHTML is good for the history books? :) It solves a series of problems of using HTML5 features (section, nav, footer, header HTML tags, data-* attributes, etc) in the Joomla core that are rendered in this templates inside a XHTML 1.0 Transitional DOCTYPE which in invalid HTML code according to the web standards. You can check that in the W3C validator: https://validator.w3.org/ Example for beez3 (component.php): Also, one of the things accessible templates need is having valid HTML code so that machines can correctly interpret the HTML code. |
Thank you that answers my question
|
ok, it's ready for testing. |
I have tested this item ✅ successfully on 920bb31 Isis
Hathor
Protostar
Beez3
|
I have tested this item ✅ successfully on a231b51 This comment was created with the J!Tracker Application at issues.joomla.org/joomla-cms/9842. |
I found an issue, when swapping from protostar to beez template my article which was set to acces: registered with a readmore link. What is expected is that the intro shows with a readmore link that asks you to register/login This comment was created with the J!Tracker Application at issues.joomla.org/joomla-cms/9842. |
I have tested this item 🔴 unsuccessfully on a231b51 This comment was created with the J!Tracker Application at issues.joomla.org/joomla-cms/9842. |
@klatte88 |
Unfortunately this pull request (as it is) breaks some error pages. Just a week ago I fixed a major bug in Gantry 4, which was caused by the same behaviour. You can quickly get the error by appending
Error page does not always have Easiest fix is to add a check to make sure the function exists or the object is Proper fix would be to make it possible to change document type before rendering error page. Right now doing that is impossible, though. |
thanks for the warning @mahagr. will check that @mbabker can you give a hand here? is there is any reason why the error pages (error.php) are not rendered like index, login, component and offline templates? That cause several issues and makes the job harder to make a custom templating to error pages. |
Ask whoever wrote |
Actually |
how about replacing (only in $doc = JFactory::getDocument(); for $doc = JDocument::getInstance('html'); To force the error pages to be rendered as HTML. |
That won't force it because it's a different document type. You need to do On Saturday, April 16, 2016, andrepereiradasilva [email protected]
|
The change i propose in
Yes, IMHO It would also solve some other bugs in error.php rendering (the mod_languages, for instance, doesn't load the css in error php pages). But, since i don't understand quite well joomla error handling, if i try to do that kind of change the result will most probably be that something gets broken 😄 . |
Again, ask whoever designed |
ok, i see. since it was |
And thanks again for the explanations. |
Also solves fatal error when using error pages in other formats
This PR has received new commits. CC: @franz-wohlkoenig, @klatte88, @waader This comment was created with the J!Tracker Application at issues.joomla.org/joomla-cms/9842. |
This PR has received new commits. CC: @franz-wohlkoenig, @klatte88, @waader This comment was created with the J!Tracker Application at issues.joomla.org/joomla-cms/9842. |
Please test again. |
After a quick code review, all error pages should now work. |
This PR get conflicts really quickly. |
Pull Request for Improvement.
Summary of Changes
Basic conversion of all site and admin templates to HTML5 (some where still XHTML 1.0 Transitional).
Testing Instructions
Check also the code changes.
Observations
All should now start with this code:
Suggestions and/or improvements are welcomed.