Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Hello, I am a co-maintainer of views_isotope module. I would like to make it work nicely with this module, but my view has a specific set of selectors. I would like to propose a single line change to this module (patch attached), which will allow developers like me to be able to hook in and specify selectors that suit us.
For instance, the way I am utilising this patch is like this:
function views_isotope_views_views_infinite_scroll_selectors_alter(&$content_selector, &$items_selector, $plugin_name) {
if ($plugin_name == 'isotope_grid') {
$content_selector = 'div.view-content > div.item-list > ul.isotope-container';
$items_selector = 'li.isotope-element';
}
}
I can see straight away that this would resolve some of the issues over at #1806628: Support Masonry module.
Comment | File | Size | Author |
---|---|---|---|
#2 | integration-hook-2633928-1.patch | 647 bytes | Chris Gillis |
Comments
Comment #2
Chris Gillis CreditAttribution: Chris Gillis commentedComment #3
mccrodp CreditAttribution: mccrodp at Open source, open mind commentedComment #4
mccrodp CreditAttribution: mccrodp at X-Team commentedI have Views Infinite Scroll working on a regular page view with unformatted list and the "Load More" link option displays when the "Load subsequent pages manually instead of automatically" option is selected, as expected.
I have the latest 2.1 version of views_isotope, an "Isotope Grid" view with the default "Isotope Configuration". I have applied the patch cleanly to the 1.x branch of Views Infinite Scroll and the "Load More" link option is not displayed when "Load subsequent pages manually instead of automatically" option is selected.
I imagine "Load More" should be displayed, so I'm setting this back to "needs work".
Should pagination also work? I see no page link options displayed on either my regular Unformatted List view nor my Isotope Grid view. A Views Infinite Scroll bug perhaps.
Also, what is required to get views_isotope working with the latest Views Infinite Scroll branch? Perhaps I can help.
Comment #5
Chris Gillis CreditAttribution: Chris Gillis commentedThanks mccrodp. If you have time to investigate further and submit an updated patch, that would be brilliant... I doubt very much that the issues you reported are due to this patch (Take a look... it's only one line - allowing other modules to hook in), so I'm going to change the status back... however it is very likely that a new ticket could be raised over at views_isotope module with a patch to ensure we are catering for all different types of functionality... I think the best person to do that is someone who is actually using it (e.g. you :)
Comment #6
mccrodp CreditAttribution: mccrodp at X-Team commentedThanks for getting back so fast Chris. Yep, I'll submit a new issue over there as perhaps it is views_isotope not using the changes you made here via the patch correctly (or I'm missing something).
I'll certainly take a look at this in terms of views_isotope and provide a patch there or updated patch here if required. However, I'm not sure what views_isotope did here, or, used to do.
Currently evaluating views_isotope & views_infinite_scroll on a project which requires isotope with a pager and with #2674656: Provide UI for "Other UI" options available within Isotope library. I'm just new to both modules this week, so any help pointing me in the right direction is appreciated and I look forward to contributing.
When I know more about items discussed above, I'll be able to review this patch in practice and anything related on the views_isotope side.
EDIT: To follow up, I'm now pretty sure View Infinite Scroll does not itself provide a pager, it hides the pager in favour of "Load More" link. The View UI usage just seems a little confusing here as it mentions pager. I have followed up with my Views Infinite Scroll integration bug over in views_isotope queue: #2678826: Views Infinite Scroll integration: "Show More" not showing when Isotope Filter added to header
Comment #7
Chris Gillis CreditAttribution: Chris Gillis commentedJust noting that this patch applies to 7.x-1.x, but does NOT apply to 7.x-2.x.
Comment #8
kopeboy CreditAttribution: kopeboy commentedHow to apply to 7.x-2.x?
Where to put that line of code?
I placed it in line 78: the infinite pager is still working but the new loaded items are not absolutely placed with isotope (masonry) like the ones in the first "page".
Comment #9
mccrodp CreditAttribution: mccrodp at X-Team for Pantheon commentedSee #2761365: Allow modules to specify their own content selector for 2.x.
Comment #10
Honza Pobořil CreditAttribution: Honza Pobořil as a volunteer commented7.x-1.x will receive no work. Migrate to 7.x-2.x.