Code won't validate

Permalink
I noticed on alot of pages the code will not validate due to the concrete5 javascript code at the top of the page. Is there any fix for this? I think the issue is that many of the symbols such as mathematical operators are not escaped properly.

It is annoying to find my code doesn't validate just because of the javascript.

Thanks

 
ringo replied on at Permalink Reply
I have discovered the cause for some of the errors here.

if you look in the application helpers folder and look for the file header_required.php you will see near the bottom that some of the 'at' symbols are not properly replaced with &

Maybe this can be marked as a bug and fixed?

Also I am getting 24 errors due to using the slideshow helper! it would be much nicer if this code would pass a valid checker.

Thanks
Tarraq replied on at Permalink Reply
It would be very nice if the code generated by c5 would validate for xhtml 1.0 Strict. Then it's our own problem to make our templates validate.

Further more, is it necessary to include javascript on the site when not logged in, into edit mode? My c5 site (http://www.apto.dk ) is very simple with no fancy functionality.
Is it possible to only include the javascript if a block on the page requires it? And as such it would not show up on pages like mine, that uses autonav and content, and that's it.

- Michael
Remo replied on at Permalink Reply
Remo
Just make sure you don't include the completely header in case you're not logged in..
Tarraq replied on at Permalink Reply
Hej Remo,

That was easy :)

I used this, stolen from somewhere on the forums.
<?php  
      global $u;
      if ($u -> isLoggedIn ()) {
      Loader::element('header_required');
      } 
      ?>

I guess this would be the way to go, if I have a website that requires say MooTools for production purposes.

- Michael
Remo replied on at Permalink Reply
Remo
But be careful with Mootools, the edit mode might break because of it...
Tarraq replied on at Permalink Reply
that's my point. Only include mootools when not logged in.
Remo replied on at Permalink Reply
Remo
as long as your layout works without javascript this works fine.. I guess it usually does (:
ScottC replied on at Permalink Reply
ScottC
is to look inside the header required file and only include the header required using code that is present there. What i mean is you see where it $cp = new Permissions($c);
if $cp->canWrite() && cp->canAddSubContent()

then include it. You might have people that register on your site that don't have editing rights (forum members etc.) and using this method might break the site for your most loyal guests.