Xonox Posted June 8, 2018 Share Posted June 8, 2018 Hi, I would like your opinion about the best way to handle the following problem: I have a project that has thousands of books and with this books I can build catalogs with 10 to 20 books. My approach was to build a "catalog" template in which I can select the books and sort them out with a "Page List Select Multiple". Of course this is a problem when you have thousands of books. So I have two questions: 1. Is it possible to have a search page selector that allows me to define in which fields I can search (title, body, etc.)? If anyone knows of such a module please point it out. With so many books, for the user, is much easier to start typing a book name to filter the results, instead of scrolling through thousands of lines. 2. In your opinion would it be best to handle this problem from the book side? Selecting, inside each book, in which catalog it is present (I have much less catalogues than books). How would I handle the book sorting, then? As we all know, with ProcessWire there's more than one way to achieve the results, if anyone had this kind of challenge I would like to know how you handle it. Thanks. Link to comment Share on other sites More sharing options...
zoeck Posted June 8, 2018 Share Posted June 8, 2018 Do you know the findMany() function ?? https://processwire.com/api/ref/pages/find-many/ Link to comment Share on other sites More sharing options...
wbmnfktr Posted June 8, 2018 Share Posted June 8, 2018 Regarding #1: I personally would prefer an autocomplete page reference here - but as you or the user (client?) has to manage thousands of books this might get out of control. You have to know all the books names, authors, whatever. This can become tricky at some point. Using a page reference with checkboxes for thousands of books might slow things down very easily. Yet another option that might not work very well here. Is it possible to automate those catalog creation? Either by genre, author, release date? What could a catalog contain? Are there patterns you could use to automate things? Could someone create a .csv with references you import later or every once in a while? Regarding #2: Both. You can connect those references either with Connect Page Fields or PagefieldPairs (I prefer this one). Updating a catalog adds the reference to book and vice versa. Update: We talk about backend/administration here, right? 1 Link to comment Share on other sites More sharing options...
Xonox Posted June 8, 2018 Author Share Posted June 8, 2018 1 hour ago, zoeck said: Do you know the findMany() function ?? Not really what I'm looking for. I'm trying to solve an Admin side usability problem. Link to comment Share on other sites More sharing options...
BitPoet Posted June 8, 2018 Share Posted June 8, 2018 @Xonox, have you seen Inputfield Page Autocomplete? 1 Link to comment Share on other sites More sharing options...
Xonox Posted June 8, 2018 Author Share Posted June 8, 2018 Quote Update: We talk about backend/administration here, right? Yes, I'm trying to solve a backend/administration problem. Quote I personally would prefer an autocomplete page reference here. That would be an ideal solution. The client usually knows the books that he wants to add to a catalog by title, author or even SKU. Is there any autocomplete reference module? Quote Is it possible to automate those catalog creation? Either by genre, author, release date? What could a catalog contain? Are there patterns you could use to automate things? No. There's not anything about the books that can be used for automation. Quote Could someone create a .csv with references you import later or every once in a while? It might be an option, but not a very elegant one, in my opinion. Quote You can connect those references either with Connect Page Fields or PagefieldPairs (I prefer this one). Updating a catalog adds the reference to book and vice versa. This might be a good solution. The user can use the administration search box to select the books and add them to the catalog and then, edit the catalog to to sort the books and make the final adjustments. I'll check out these modules. Thanks @wbmnfktr Link to comment Share on other sites More sharing options...
wbmnfktr Posted June 8, 2018 Share Posted June 8, 2018 1 minute ago, Xonox said: Is there any autocomplete reference module? Sure. As mentioned above by @BitPoet. Already built-in. 1 Link to comment Share on other sites More sharing options...
Xonox Posted June 8, 2018 Author Share Posted June 8, 2018 19 minutes ago, BitPoet said: @Xonox, have you seen Inputfield Page Autocomplete? @BitPoet and @wbmnfktr, this might be EXACTLY what I'm looking for. I'll take a look. Thanks! I see that this a Core module, but not installed when we first install ProcessWire, I didn't remember to look there. I already used PW on about 20 projects, and for every challenge I've came across there's always a simple answer that this forum provides. Thanks. 2 Link to comment Share on other sites More sharing options...
elabx Posted June 8, 2018 Share Posted June 8, 2018 Also take a look at pro module Visual Page Selector which I think enables a kind of lister in the page editing. 1 Link to comment Share on other sites More sharing options...
Macrura Posted June 8, 2018 Share Posted June 8, 2018 3 hours ago, Xonox said: 1. Is it possible to have a search page selector that allows me to define in which fields I can search (title, body, etc.)? If anyone knows of such a module please point it out. With so many books, for the user, is much easier to start typing a book name to filter the results, instead of scrolling through thousands of lines. InputfieldSelectizeMultiple or ajax version – the ajax version was designed for this purpose you describe; non-ajax version has only been tested to work on maybe 500-600 select items 2 Link to comment Share on other sites More sharing options...
bernhard Posted June 9, 2018 Share Posted June 9, 2018 I've done such a task by using my RockGrid field and connecting it via JS to a Page Reference field. You have a nice UI for filtering and listing items (books in your case) with different columns and you can just select + add them to your reference field. If you are happy with your autocomplete field, great. If not you can contact me ? 3 Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now