Karl_T Posted May 16, 2017 Share Posted May 16, 2017 Greeting. I am looking for a way to have a user defined criteria on each page. It would be best to be a field inside the page editing, then maybe output a, or array of, selector string when call. Every page can have different criteria input by the user. The user interface would be something like the filter inside the Lister, with AND, OR for multiple criteria. The usage maybe like this: $criteria = $pages->get(1234)->criteria_field; // OR field become array of selector string $valid = false; foreach($crieria as $c){ $valid = $pages->find($c)->has($page); if($valid){ // do whatevery if the page fit the criteria break; } } Above is just my imagination. Is there anything close to this in PW at the moment? Or, is there any proper way to achieve this using PW native method? I want to have this to check: Page's parent(s'), own, children's template, name, field value etc Thanks. Link to comment Share on other sites More sharing options...
Robin S Posted May 16, 2017 Share Posted May 16, 2017 26 minutes ago, Karl_T said: It would be best to be a field inside the page editing, then maybe output a, or array of, selector string when call. Sounds like FieldtypeSelector: Modules > Install > FieldtypeSelector 2 Link to comment Share on other sites More sharing options...
szabesz Posted May 16, 2017 Share Posted May 16, 2017 46 minutes ago, Robin S said: Modules > Install > FieldtypeSelector Actually it is Modules > Core > Selector ...but yeah... 1 Link to comment Share on other sites More sharing options...
Karl_T Posted May 16, 2017 Author Share Posted May 16, 2017 Looks like it is a good place to extend for my need. Thanks a lot! Right now there are too much fields to choose from. This will make my customer nervous. Link to comment Share on other sites More sharing options...
Robin S Posted May 16, 2017 Share Posted May 16, 2017 9 hours ago, szabesz said: Actually it is Modules > Core > Selector Only if you have already installed it, and this module is not installed by default. 1 Link to comment Share on other sites More sharing options...
szabesz Posted May 17, 2017 Share Posted May 17, 2017 7 hours ago, Robin S said: Only if you have already installed it, and this module is not installed by default. Ah, I always install it by default. Thanks for reminding me. I often trip over these naming inconsistencies. Also, regarding modules, I still find it confusing that the word "installing" is used for both getting the files of a module and also for running the actual installation process. 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