I am trying to: Display posts and its content inside a modal via a View
Link to a page where the issue can be seen: hidden link
You can see that when you click on one of the boats for the first time after loading the page, all the content loads fine like the gallery and reviews slider etc. However, when you then close the modal and look at another one - the content is not there! By the looks of it, it only seems to be the sliders not loading. Is there anything i have missed in terms of setting the view up correctly?
I have set it up all in a view called 'Fleet Feed'.
Is it just the modal causing conflict here?
It looks like there's a problem with slick gallery initialization, because there's a JS error in the console when I open the modal a second time. The markup produced by the View contains the correct information, it's just not displayed in the modal correctly.
slick.min.js:formatted:634 Uncaught TypeError: Cannot read property 'add' of null
at Object.e.initADA (slick.min.js:formatted:634)
at Object.e.init (slick.min.js:formatted:623)
at new <anonymous> (slick.min.js:formatted:134)
at a.fn.init.i.fn.slick (slick.min.js:formatted:1345)
at scripts.js:21
That's triggered here:
e.$slides.add(e.$slideTrack.find(".slick-cloned"))
...because e.$slideTrack is null. Not sure why exactly. Looks like there's an onShow event handler in your scripts.js file that re-initializes all the slick galleries each time the modal is opened. I'd start digging around here.
function gallerySlick() {
$(".boat-modal").on("show.bs.modal", function(e) {
setTimeout(function() {
...
Cheers Christian. I was oblivious to checking the error logs. Much appreciated.