Selection Conditions

A quick run-through of how to create a custom condition in Drupal 8.

What is a condition in Drupal 8?

A condition is normally used for block placement. Pretty common in D7.

But we're using page manager...

A condition can also be used on page manager pages. "Selection Condition" in D7 and D8.

Problem

The summit's have a pre-mode and a post-mode.

"Great use a visibility rule!"

Not available at the moment.

Besides, I think that

visibility rules can cause

confusion for future dev.

Enter condition

This can easily be reused elsewhere.

Provides devs a quick way to see that there are different layouts for a "state".

Easy to start

drupal generate:plugin:condition [options]

Let's see some code

Made with Slides.com