An user pays credits for publishing a post

Paying credits for doing actions on a site makes it necessary to check user credits before performing the action. So I use an "Before saving content" event and a "Entity has credits" action to do so.

To avoid publishing the post we send the user back to the add content form using a custom "Execute custom PHP code" action. In order to allow PHP snippets you have to activate core module "PHP filter".

The first rule looks like that:

An user earns credits for publishing a post

After creating Credit Types at admin/commerce/credits/types (see README.txt for details) you are ready to use credits account. They are linked to users, so adding and removing credits must be related to an user entity.

Here a simple rule which adds 1 credit to users who write a blog post:

Drupal 8 Release

Viewfield 8.x-3.x

The Viewfield module defines an entity reference field type to display a view. Viewfield enables an administrator or content author to integrate a views display into any fieldable entity, such as content, users or paragraphs. In addition, through the use of the Always use default value setting, the same view(s) may automatically be placed into all entities in a bundle. Viewfield has considerable theming support, making it easy to customize presentation.

BS Base

@TODO - this will be a documentation for bs_base base theme.

Drupal 8: geolocation base fields on custom entity types

I had a requirement to be able to record lots of different types of "Point of Interest", that will require varying fields but have a common requirement to store location across them all. So, my solution would be to create a custom content entity type that supported bundles, where the base entity type had geolocation (and a couple of other things) as base fields.

To achieve the scenario above, I created a content entity class as below:


Subscribe with RSS Subscribe to RSS - Intermediate