Best place to put this code?
Permalink
I am hardcoding a block into a pagetype, and it requires some js and css to be loaded, in these two lines
At the moment I am putting it in my footer.php because it actually works there. If I put it in header.php instead, the block doesn't work. But of course, putting it in the footer means the html doesn't validate as the 2 lines are appearing inside <body> at the bottom of the "page" div.
One of the pages I'm using it on ishttp://www.wallbrink.com.au/concrete5/index.php/portfolio/infrastru...
How can I get the 2 lines loaded in the header but so the block still works? Thanks for any tips.
<link rel="stylesheet" media="screen" type="text/css" href="/concrete5/packages/jb_popup/blocks/jb_popup/css/prettyPhoto.css?" /> <script type="text/javascript" src="/concrete5/packages/jb_popup/blocks/jb_popup/js/jquery.prettyPhoto.js?"></script>
At the moment I am putting it in my footer.php because it actually works there. If I put it in header.php instead, the block doesn't work. But of course, putting it in the footer means the html doesn't validate as the 2 lines are appearing inside <body> at the bottom of the "page" div.
One of the pages I'm using it on ishttp://www.wallbrink.com.au/concrete5/index.php/portfolio/infrastru...
How can I get the 2 lines loaded in the header but so the block still works? Thanks for any tips.
Script could be left in the footer and the page should validate. Or you could try using addHeaderItem so that C5 can then sort out a bit more of the loading sequence for it. (don't know if this will solve your problem, just something to try)