O'Reilly logo

Drupal 8 Blueprints by Alex Burrows

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Harnessing the power of variants

So now that we have our basic variant for the Lesson content type created, let's look at changing this so different user roles see different variants.

We want to have our authenticated user see our content in its entirety and we want our anonymous user to see different content, more of a teaser to what they can expect to see if they register.

For us to do this, we need to edit our variant we have just created and add a new selection criteria. So, click on our variant name and then click on Selection criteria. Now, we want to add a new condition, so change Content Type to User Role. What this now will let us do after clicking Add Condition is give us access to the conditions associated to the User entity type. ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required