Is It Possible to Created Nested Tabs in the Backend of October CMS?

- 1 answer

Ad

Is it possible to create sub (or nested) tabs in the backend of October CMS?

I can create regular tabs like this:

tabs:
  fields:
    layout:
      label: Layout
      description: Choosed between a boxed or wide layout.
      type: dropdown
      options:
        stretched: Stretched
        boxed: Boxed
      span: left
      tab: Site
    smooth_scrolling:
      label: Smooth Scrolling
      commentAbove:  Enable or disable smooth scrolling on Windows desktop PCs.
      type: switch
      span: left
      default: true
      tab: Blog

What I would like to do is create nested tabs underneath a particular tab (for instance, using secondaryTabs underneath the Site tab).

Is this possible? If so, any idea how to do it?

Thanks.

Ad

Answer

Ad

Currently it is not possible using default OctoberCMS yaml files.

It's a bit of a hack but you can create the tabs in the controllers .htm file and then render the form fields inside the tab panels.

You can render each tab level of fields separately:

$this->formRender(['section' => 'outside'])
$this->formRender(['section' => 'primary'])
$this->formRender(['section' => 'secondary'])
Ad
source: stackoverflow.com
Ad