getgrav / grav-theme-quark

MIT License
64 stars 58 forks source link

How to assign offset-box #119

Open CodeAlDente opened 5 years ago

CodeAlDente commented 5 years ago

Is it possible to assign the class offset-box to the features module within Grav? When I try to do so in the expert mode, I am getting the following error message.

An exception has been thrown during the rendering of a template ("Template "modular/features.html.twig" is not defined.").

This error can be reproduced by using the following lines and saving the features module (in expert mode): https://github.com/getgrav/grav-theme-quark#features-modular-options

jleaders commented 4 years ago

offset-box appears in the skeleton but it seems undocumented?

jason-unleashed commented 4 years ago

I found a solution.
"/user/themes/quark/blueprints/modular/features.yaml" is missing an option for the offset-box. I added "offset-box: Standard with offset-box" as the last option and now it works.

title: Features
'@extends': default

form:
  fields:
  tabs:
    fields:
      features:
        type: tab
        title: Features
        fields:
          header.class:
            type: select
            label: Layout
            default: small
            size: medium
            options:
              small: Small   = 4 / 3 / 2 columns
              standard: Standard  = 3 / 2 / 1 columns
              offset-box: Standard with offset-box

        header.features:
          name: features
          type: list
          label: Features

          fields:
            .icon:
              type: iconpicker
              label: Icon
            .header:
              type: text
              label: Header
            .text:
              type: text
              label: Text
            .url:
              type: text
              label: Link
CodeAlDente commented 4 years ago

I just tested it by applying that CSS class and it worked. Thanks!

@rhukster /cc

robelkin commented 4 years ago

Just had this same issue. features.yaml just needs that one line added, otherwise the admin panel will default to "small" when saving in non-expert mode, which means that box will no longer be overrunning the header and it will force the whole page into full width. That's how I ended up here.

Including it in expert mode gives the mentioned exception without changing the features file.