Skip to main content

This site requires you to update your browser. Your browsing experience maybe affected by not having the most up to date version.

General Questions /

General questions about getting started with SilverStripe that don't fit in any of the categories above.

Moderators: martimiz, Sean, Ed, biapar, Willr, Ingo, swaiba

Need help modifying generic views search results

Go to End



Community Member, 48 Posts

21 October 2012 at 3:39am

Edited: 21/10/2012 3:40am

I'm using the generic views module to display search results for my Deliverable class. The module was working great until the requirements of the project changed. The deliverables were just items the users added to their project one by one. Now each project has a default set of deliverables (43 of them) that is automatically added to their project.

When displaying the deliverables I don't want to display what I call "Blank Deliverables" in my search results (most deliverables are now blank because of automatically adding them to the project). In my generic views I have condition set that only displays BlankDeliverables == 0. This does filter out all the blank deliverables.

The problem: The first page of my results (from MoreThanOnePage function) doesn't display anything. If I click in page 2 of the results I start to see the deliverables. I'm guessing this is because my search results contains many more items than what I'm displaying.

I believe I need to somehow remove these blank deliverables from the search results (instead of filtering them out by not displaying them in the template).

Also, I noticed that if I use any of the filters in the form, I don't have a blank first page (only with the default search results).

Any help would be appreciated.