Jump to content

Criteria field


Karl_T
 Share

Recommended Posts

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

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

2017-05-16_233153.png.573886f54a03f45a9895f65f123de888.png

  • Like 2
Link to comment
Share on other sites

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

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...