tutmeister Posted September 5, 2012 Report Share Posted September 5, 2012 I'm developing a skin and am having trouble displaying all the content that relies on jQuery correctly. I have everything working perfectly in a static file, but when I break it up to go into templates is where it goes wrong. Essentially, what I've narrowed it down to is if I don't call jQuery in both the layout.tpl and core_htmlhead.tpl the elements replying on jQuery fail gracefully as designed. But obviously I shouldn't have to be calling jQuery twice...so has anyone encountered this before? Quote Link to comment Share on other sites More sharing options...
tutmeister Posted September 5, 2012 Author Report Share Posted September 5, 2012 So is everyone using jQuery for their skin here able to call it once only in the core_htmlhead.tpl and have no problems, or has no one reading this seen this problem before? Quote Link to comment Share on other sites More sharing options...
Moderators Kyle Posted September 6, 2012 Moderators Report Share Posted September 6, 2012 You shouldn't be calling the same jQuery twice, Call it in the layout.tpl if you can, if not then copy the core_htmlhead to your skin and change around the JQuery whenever it works fully. Quote Link to comment Share on other sites More sharing options...
tutmeister Posted September 6, 2012 Author Report Share Posted September 6, 2012 Kyle, I know I shouldn't be calling it twice, hence the post. I have tried it in both locations and the only time my jquery elements behave correctly is when I call it from both locations. I will have to use firebug to track down why this is happening if no one else has this issue, as it's obviously something to do with the way my skin is coded. Quote Link to comment Share on other sites More sharing options...
bolli Posted September 6, 2012 Report Share Posted September 6, 2012 Where are you calling the jquery in relation to the code that depends on it? Quote Link to comment Share on other sites More sharing options...
tutmeister Posted September 6, 2012 Author Report Share Posted September 6, 2012 In core_htmlhead.tpl and at the top of layout.tpl under the comment for custom Javascript. Quote Link to comment Share on other sites More sharing options...
Guest lorathon Posted September 6, 2012 Report Share Posted September 6, 2012 I thought that the layout.tpl made the core_html files obsolete. What happens if you just have the jQuery call in the layout template? I do not use the layout template but I seem to remember something about this. Quote Link to comment Share on other sites More sharing options...
tutmeister Posted September 7, 2012 Author Report Share Posted September 7, 2012 2 out of 3 items that rely on jQuery stops working if I do that Jeff. After some fault-finding, I'm even more baffled: If I remove all JS calls from layout.tpl and just put them in core_htmlhead.tpl nothing works. But if I then then call the jQuery and jQueryUI a second time within core_htmlhead.tpl, right below each other, it all works fine. Like this: <script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js"></script> <script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js"></script> <script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jqueryui/1.8.21/jquery-ui.min.js"></script> <script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jqueryui/1.8.21/jquery-ui.min.js"></script> I moved everything else below them just to make sure it wasn't a dependency issue and it still displayed the same behavior. So obviously there is something wrong and I need a break! I will likely start fresh with a working HTML-only template, moving it into phpVMS bit by bit to determine the problem. I haven't experienced this before. Quote Link to comment Share on other sites More sharing options...
tutmeister Posted September 18, 2012 Author Report Share Posted September 18, 2012 Solved. After trying it every which way, all I had to do was delete core_htmlhead.tpl in the skin folder, and let phpVMS fall back on the original in the Core/templates. Quote Link to comment Share on other sites More sharing options...
Guest lorathon Posted September 18, 2012 Report Share Posted September 18, 2012 Sorry Paul. I missed your response. Glad you got it fixed though. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.