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
<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.

stretchrt
 
JohntheFish replied on at Permalink Best Answer Reply
JohntheFish
You should be able to put the css line into the header regardless. Then the page will validate.

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)
stretchrt replied on at Permalink Reply
stretchrt
Thanks John, just moving the css line to the header did the trick.
Highlight replied on at Permalink Reply
Hi. Did you get your prettyPhoto to work? I am struggling whit it. perhaps you could guide me in some deriction on how i can get it to work?