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.
If I have "display all" in the pager setting, then it works for all rows, even with the exposed filter option selects. But if I limit the display and use a pager, then any row that was not initially displayed will not have the background image applied.
Using Drupal 7.39 with Views 7.x-3.11+26-dev and jquery 1.9.
Comments
Comment #2
kenheim CreditAttribution: kenheim commentedComment #3
kenheim CreditAttribution: kenheim commentedComment #4
kenheim CreditAttribution: kenheim commentedComment #5
Leeteq CreditAttribution: Leeteq commentedPlease verify if it is also a problem with JQuery 1.7 (which is the "most compatible" version as of now). (Just set the JQuery_update module to use 1.7 to do a test.)
Comment #6
koddr CreditAttribution: koddr commentedSimilar trouble with Views Infinite Scroll module — this issue.
Please fix it.
Comment #7
PolCould you describe how to reproduce the bug please ?
Comment #8
leahtard CreditAttribution: leahtard at The Jibe commentedI am experiencing this with the Views Load More module as well. Here is how it is working for me:
- On page load, I have 6 news items being loaded.
- Each news item has a different background image and it is targeting a class that uses a replacement pattern. ie: node-[node:nid]
- On load, the six unique images are correctly applied to their 6 news items.
- When I click the "Views Load More" button, the 6 new items that appear, do not have background images.
I can see that the inline CSS added to the page only includes the first 6 items. When the ajax call is triggered to load more news items, there are no new classes appended for the new news items.
I hope that provides you will be more specific use case to work with. Happy to help further where I can!
Cheers, Leah
Comment #9
dman CreditAttribution: dman as a volunteer and at Sparks Interactive commentedWhen you get these symptoms, it's a case of the code using drupal_add_css() - which should be avoided for rendering persistent content. It's not AJAX (or entity/page_cache) safe.
Instead, any code that previously used drupal_add_css() should be refactored to use drupal render() '#attached' property instead.
A description of how to do this is at
https://api.drupal.org/comment/53463#comment-53463
Although the examples usually give a filename for css to add, I'm pretty sure that #attached will also allow you to give it verbatim css to insert when needed.
Comment #10
JParkinson1991 CreditAttribution: JParkinson1991 commentedDid anyone every manage to find a solution to this?
It seems the drupal_add_css calls need to be triggered again on ajax update, but how?
Comment #11
PolThis should be fixed in latest 8.x-1.2, reopen if not.