jromine's picture

At Home > Administration > Structure > Layouts > Templates (admin/structure/layouts/settings/flexible-template) it is possible to create a flexible layout template, where each region has configuration settings to set the row width: fixed, fluid or full width:

For the Backdrop core templates, these per-region settings do not appear to be available.

Can layouts have settings?

If I were to develop my own contributed layout (e.g., similar to harris flexible), is it possible for my layout to have settings of its own?  I would like to be able to set certain characteristics of my layout (e.g., to switch between fixed/fluid widths).

 

Comments

indigoxela's picture

For the Backdrop core templates, these per-region settings do not appear to be available.

That's by design. Core templates have their container classes hardcoded in their layout--the_name.tpl.php files.

If you want to change the container classes in core templates, you'd copy the file over to your theme and make adaptions there.

But I think, using flexible layout templates covers all you need.

If I were to develop my own contributed layout... is it possible for my layout to have settings of its own?

Which sort of setting? You'd have template files and you'd preprocess the available variables. Not sure about the UI for that.

To be honest, I completely switched to flexis.

jromine's picture

Adding one binary choice (to auto-hide sidebars with no content) results in one additional layout variant (harris vs harris_flexible). Adding a second choice for fixed or fluid layout would multiply the choices by two again. A few more options and you could end up with 16 or 32 variants of a single layout.

It could be helpful if contrib layouts could offer options/settings of their own in the Backdrop UI, in the way that themes and modules do.