Skip Navigation

[Resolved] Post Content not being pulled in. Only showing on first modal click

This support ticket is created 5 years, 8 months ago. There's a good chance that you are reading advice that it now obsolete.

This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.

Sun Mon Tue Wed Thu Fri Sat
8:00 – 12:00 8:00 – 12:00 8:00 – 12:00 8:00 – 12:00 8:00 – 12:00 - -
13:00 – 17:00 13:00 – 17:00 13:00 – 17:00 13:00 – 17:00 13:00 – 17:00 - -

Supporter timezone: America/New_York (GMT-04:00)

This topic contains 2 replies, has 2 voices.

Last updated by Paul 5 years, 8 months ago.

Assisted by: Christian Cox.

Author
Posts
#1223909

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?

#1224020

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() {
            ...
#1224032

Cheers Christian. I was oblivious to checking the error logs. Much appreciated.