Dynamically Populating Portfolio-Masonry and Other Templates with JavaScript

3 replies · opened Aug 31, 2018

Sshasan8Aug 31, 2018

Hello,

The majority of my site's use of Canvas will be dynamically populating templates. Currently I am working with portfolio-masonry. The JS code is successfully modifying the page HTML with <article>s but the portfolio items are not displayed. I assume I need to trigger a .widget, but don't know which one.

Is there documentation or an easy way to know what each template's JS dependencies are so that after populating the HTML it can be rendered? Or a simple way to trigger everything?

Thanks.

Sshasan8Sep 4, 2018

FYI, The DIV is <div id="additionalImages" class="portfolio grid-container portfolio-masonry clearfix"></div> and I am using $('#additionalImages').append(slideContent); to add articles. Canvas keeps setting the DIV's height to 0, so I am trying $('#additionalImages').height('auto'); but Canvas keeps setting the height back to 0 on resizing the window and with other situations.

Sshasan8Sep 4, 2018

"grid-container" appears to be the class associated with the div height being set to 0. Removing it resolves the issue but breaks items being arranged and rearranged in the grid by size.

SSemicolon WebSTAFFSep 6, 2018

Hello,

Adding the Items to the Portfolio Grid that is powered by the jQuery IsoTope Plugin will cause issue if you follow the General jQuery Append method. Please consider using the IsoTope Append method to achieve this functionality: https://isotope.metafizzy.co/methods.html#adding-and-removing-items .

This will definitely work fine. Hope this Helps!

Let us know if we can help you with anything else or if you find any further issues.

Have the same question, or something new?

Sign in to the Canvas dashboard to reply or open your own topic. Canvas owners get direct help from the SemiColonWeb team.

Reply on the dashboard