<style> tag in code not validating

Permalink
Hi all.

I have built my site, which validated fine, but as soon as I place into Concrete 5 it does not.

The code in question is:

<link rel="stylesheet" type="text/css" href="/excointouch/root/concrete_root/concrete/css/ccm.base.css" />
<script type="text/javascript" src="/excointouch/root/concrete_root/concrete/js/jquery.js"></script>
<script type="text/javascript" src="/excointouch/root/concrete_root/concrete/js/ccm.base.js"></script>
<style>
</style>
<!-- Site Header Content //-->

The problem is the:
<style>
</style>

How can I delete this?!? I can't find at anywhere.

Please help!

senshidigital
 
senshidigital replied on at Permalink Reply
senshidigital
OK I found whats causing it. Its in the file 'block_styles.php'. This is the offending code:

//add to header
$v = View::getInstance();
$v->addHeaderItem("<style> \r\n".$blockStylesHeader.'</style>', 'CONTROLLER');
self::$headerStylesAdded=1;


Whats the best way to make this validate? Delete it? I did delete and the site still worked and I was able to edit.

Is there a way not to delete it and make it validate?

I am going to try a few things too.
senshidigital replied on at Permalink Reply
senshidigital
Got it to work:

//add to header
$v = View::getInstance();
if($blockStylesHeader != '') {
$v->addHeaderItem("<style> \r\n".$blockStyleHeader.'<style>', 'CONTROLLER');
self::$headerStylesAdded=1; }
}
Tao replied on at Permalink Reply
Tao
more
//add to header
$v = View::getInstance();
if($blockStylesHeader != '') {
    $v->addHeaderItem('<style type="text/css">'."\r\n".$blockStyleHeader.'</style>', 'CONTROLLER');
    self::$headerStylesAdded=1; 
}
senshidigital replied on at Permalink Reply
senshidigital
Nice one that works too butpnly if you don't have the <?php open and closing around it...

//add to header
$v = View::getInstance();
if($blockStylesHeader != '') {
$v->addHeaderItem('<style type="text/css">'."\r\n".$blockStyleHeader.'</style>', 'CONTROLLER');
self::$headerStylesAdded=1;
}

}
Tao replied on at Permalink Reply
Tao
"<?php" entered by the automatic operation when inputting, "[code]".
scalait replied on at Permalink Reply
scalait
this is fixed in 5.4