I'm noticing that the Layout Plugin isn't making use of the hook_ds_pre_render_alter() function.
That means that the option on a custom layout to add entity classes isn't being used, but also that your custom layout can't be used in for example a node-type context.
You'll probably have to manually create these settings for your layout, but in fact, the functionality is already available withing DS.

I don't know wheather this is a bug report or a feature request.
I think if this module extends ds layouts, it would be a logical feature to be able to use the default classes and alter these with the ds_pre_render function.

Comments

ReBa created an issue. See original summary.

dsnopek’s picture

Project: Layout Plugin (obsolete, use core's Layout Discovery) » Display Suite
Version: 8.x-1.0-alpha23 » 8.x-2.x-dev

It should be up to Display Suite to make sure this information is available to layouts -- Layout Plugin doesn't know anything about entities, it has no idea what it is actually rendering in its layouts. So, moving to Display Suites queue!

aspilicious’s picture

Status: Active » Postponed (maintainer needs more info)

Display Suite layouts have entity classes attached if you leave the defaults as is.
Are you using a Display Suite layout?

ReBa’s picture

When I select a default layout, the entity classes are indeed attached.
Thing is, when you create your custom layout with the layout plugin, which is based on ds, you don't get the information that is passed on to the default layouts of ds.
As I understand, in order to have this information available by default to create a custom layout, the variables of the default ds layout should be passed in order to create configurable custom layouts.
Correct me if I'm wrong, @dsnopek

swentel’s picture

Version: 8.x-2.x-dev » 5.0.x-dev
swentel’s picture

Status: Postponed (maintainer needs more info) » Closed (outdated)

Double checked this, this seems to be working fine, with tests, so closing.

DS now uses the layout theme hook as well, so everything can be altered more easily in hook_preprocess_layout() (which DS implements by default as well)