Greetings, I am trying to directly modify some files in the persona theme to include the slick carousel slider as a header. I've added it as an inline script in header.tpl and also changed my requirejs-config accordingly:
I find that the slider and site is working fine only on a fresh page load/reload. On a click of any button to navigate, the slider breaks and i get these errors:
Uncaught TypeError: $(...).timeago is not a function
Uncaught TypeError: $(...).tooltip is not a function
Uncaught TypeError: widgetAreas.find(...).timeago is not a function
Probably suggesting that jQuery was loaded more than once. I'm inclined to think that this has got something to do with how I've changed the requirejs above. However leaving out the above change will lead to:
Uncaught TypeError: Cannot read property 'fn' of undefined in slick.min.js
Possibly suggesting the jQuery wasn't loaded?
I've also looked and followed the tips here but nothing seems to work. I just feel that I'm really close to getting it done.
It gets messy when you try to hack it this way. I was attempting to remove the sidebar code from home.tpl, then copy it to <div class="col-xs-3">//sidebar content</div> infooter.tpl, but it does not work very well. The best approach would be to require a sidebar.tpl.