I created a custom layout template named layout--blog.tpl.php. I assigned it to the Blog content type. The template is located in /my_theme/templates/layout--blog.tpl.php, but for some reason, it is not being applied. I performed a full cache clear and other manipulations. If I rename layout--blog.tpl.php to layout--moscone-flipped.tpl.php, everything works.

Accepted answer

Hi @Gnome and welcome to Backdrop

When I create custom layout templates I put them in /layouts/custom/my_layout

Note: you can split modules and layouts between contrib and custom within the modules and layouts folder if you prefer but you don't have to.  If everything goes in the top level it would be:

/layouts/my_layout

Within that folder, I create my_layout.info which might have in:

type = layout
name = My Layout
description = A fork of the Boxton layout with a sticky navigation bar.
backdrop = 1.x

; Specify regions for this layout.
regions[header]     = Header
regions[navigation] = Navigation
regions[top]        = Top
regions[content]    = Content
regions[bottom]     = Bottom
regions[footer]     = Footer

; The default region automatically receives the "Main Content" block if needed.
default region = content

; Include a file for special preprocessing of this layout's variables.
; file = boxton.php

; Default stylesheets for this layout
; stylesheets[all][] = boxton.css

; Preview
preview = boxton.png

; Include the Bootstrap4 Grid System
libraries[] = bootstrap4-gs

And then the template that would be layout--my-layout.tpl.php

Layout templates in the theme are for overriding existing templates, not for brand new layout templates.

I hope this helps your understanding.

Comments

Hi @Gnome and welcome to Backdrop

When I create custom layout templates I put them in /layouts/custom/my_layout

Note: you can split modules and layouts between contrib and custom within the modules and layouts folder if you prefer but you don't have to.  If everything goes in the top level it would be:

/layouts/my_layout

Within that folder, I create my_layout.info which might have in:

type = layout
name = My Layout
description = A fork of the Boxton layout with a sticky navigation bar.
backdrop = 1.x

; Specify regions for this layout.
regions[header]     = Header
regions[navigation] = Navigation
regions[top]        = Top
regions[content]    = Content
regions[bottom]     = Bottom
regions[footer]     = Footer

; The default region automatically receives the "Main Content" block if needed.
default region = content

; Include a file for special preprocessing of this layout's variables.
; file = boxton.php

; Default stylesheets for this layout
; stylesheets[all][] = boxton.css

; Preview
preview = boxton.png

; Include the Bootstrap4 Grid System
libraries[] = bootstrap4-gs

And then the template that would be layout--my-layout.tpl.php

Layout templates in the theme are for overriding existing templates, not for brand new layout templates.

I hope this helps your understanding.

Hello, @yorkshirepudding! Thanks a lot, I got it, all sorted out.