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
[Feature] Add ability to override meta tag in page_theme.php by making it conditional in header_required.php #4310
Comments
Well, the fastest solution would be that you remove your charset meta tag and use the one provided by concrete5. BTW, since version 5.7.5.9 you have also another solution: add this code to your Events::addListener('on_header_required_ready', function($event) {
$metaTags = $event->getArgument('metaTags');
unset($metaTags['charset']);
$event->setArgument('metaTags', $metaTags);
}); |
I like the second approach as it allows customization which is better in my opinion. Can the same be accomplished through package on_start()? |
Sure! |
Nice. Let me give it a shot. |
Aren't they essentially the same? http://stackoverflow.com/questions/4696499/meta-charset-utf-8-vs-meta-http-equiv-content-type Couldn't you just remove the meta charset tag from the bootstrap chop since concrete5 already provides a content type? It's not like you don't have to remove other tags from the header (like title, meta description, etc...) |
Thanks for the link (useful). I prefer the new shorter modern format that was introduced with HTML5, and maybe the old style will become deprecated in future. An extra benefit for the request is the ability to configure the output of header_required. My header.php start's as below (with these three meta tags appearing first)
|
Since it sounds like the event will work for this use case, I'm going to close this issue. |
I follow bootstrap's recommendation for starting a basic template (see code below) when developing my themes. This results in a theme that doesn't pass w3c validation with the following error:-
A document must not include both a meta element with an http-equiv attribute whose value is content-type, and a meta element with a charset attribute.
My header.php already includes <meta charset="utf-8"> as the first tag in head but concrete5 also generates <meta http-equiv="content-type" content="text/html; charset=UTF-8"/> hence the duplication.
Since we can already conditionally load assets for IE in page_theme with requireAsset('javascript-conditional', 'html5-shiv'), it would also be nice to adjust concrete5's header_required output somehow without having to override header_required itself as its not recommended.
The option doesn't have to be configured from page_theme, any other solution would work just as well.
Here is bootstrap's basic template which I base my header.php on
Martin
The text was updated successfully, but these errors were encountered: