Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

wrong filteritems with multiple contentlisting tiles on one page #150

Closed
petschki opened this issue Dec 15, 2021 · 1 comment · Fixed by #178 · May be fixed by #151
Closed

wrong filteritems with multiple contentlisting tiles on one page #150

petschki opened this issue Dec 15, 2021 · 1 comment · Fixed by #178 · May be fixed by #151

Comments

@petschki
Copy link
Member

Given Mosaic Page layout:

+-----------------------+
| Contentlisting #1     |
+-----------------------+
| Filter Tile with      |
| content_selector of.  |
| Contentlisting #2.    |
+-----------------------+
| Contentlisting #2     |
+-----------------------+

What I expect:
Filter Tile has filteritems of Contentlisting #2

What you get:
Filter Tile has filteritems of Contentlisting #1

Why?
Because the ICollectionish adapter always sets self.collection of the first found contentlisting tile when initializing. See here https://github.com/collective/collective.collectionfilter/blob/master/src/collective/collectionfilter/tiles/__init__.py#L91

Solution:
self.collection should always be set to the actual found contentlisting tile in selectContent() here https://github.com/collective/collective.collectionfilter/blob/master/src/collective/collectionfilter/tiles/__init__.py#L102

@djay
Copy link
Member

djay commented Jan 13, 2022

from memory it has to default to the first listing tile because we have to give a default when creating the filter tile and at that stage there is no custom css selector. But I think it reevaluates which listing its using at run time by default so will use the correct one later?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants