Hello

and sorry for another presumably stupid question:

Is there any restriction, condition, requirement, limitation etc. for the "Main page content" block to show up in the block list ("Add block" popup) when trying to add a block to a region?

In my project, this block is visible/available on the default layout – even if I change the layout template, and even if I choose a custom template, and I can put it to any region. But this block does not appaer on any other layout, regardless which layout template is used: Search for "Main..." in the block list returns "No blocks match your search."

I notice the same behaviour an a fresh test-installation, so I don't think this is specific to my project.

Any help/advice is, as always, much apreciated!

Best regards

 

 

Accepted answer

I think this contributed module might be useful for you. It's helpful if you want to create a layout for specific views or multiple views.

https://backdropcms.org/project/layout_wildcard

Most helpful answers

From my experience, using views block displays (instead of pages) is generally a good fit for Backdrop and its Layout system. I don't know your site, but I think you can achieve your goal with one layout by adding all blocks in that layout, and add a visibility condition to every block.

If your layout overrides a path already provided by the site, like "node/%", then it's a "layout override". If the layout creates a totally new path, like "my/strawberries" then it's a page layout.

The home page  is a special type of page layout provided by Backdrop. Even if you override it, it will still be a page layout. You see, the home page doesn't have any set content by itself. It's just a collection of blocks, which you can change.

Typically there are few "layout overrides". They are used to override the output of things like nodes and taxonomy terms, which have an existing path already even before you create a layout. 

This block will only appear if you are overriding an existing page path. 

These types of layouts are called "Layout overrides" and are defined in the "How Layouts work" fieldset:

Layout overrides are layouts that override existing pages on the site. Without these layout overrides, these pages would use other layouts.

This will not appear for "layout pages". The UI separates these two types of layouts by type.

Comments

This block will only appear if you are overriding an existing page path. 

These types of layouts are called "Layout overrides" and are defined in the "How Layouts work" fieldset:

Layout overrides are layouts that override existing pages on the site. Without these layout overrides, these pages would use other layouts.

This will not appear for "layout pages". The UI separates these two types of layouts by type.

Thank you very much, argiepaino, for your I help!

I think I understand, but... two more question:

1. How do I create a Layout override? For testing/learning, I changed the Home page layout (added a block). It's storage status is no "overriden", but section "Layout overrides" still outputs "No layout overrides have been created yet."

2. What are the specific purposes or use cases for "Layout pages" and "Layout overrides"? I can't figure out which to use in which situation.

Best regards
 

If your layout overrides a path already provided by the site, like "node/%", then it's a "layout override". If the layout creates a totally new path, like "my/strawberries" then it's a page layout.

The home page  is a special type of page layout provided by Backdrop. Even if you override it, it will still be a page layout. You see, the home page doesn't have any set content by itself. It's just a collection of blocks, which you can change.

Typically there are few "layout overrides". They are used to override the output of things like nodes and taxonomy terms, which have an existing path already even before you create a layout. 

Thank's again, I'm advancing... but still stuck...

In my use case, the paths are provided by views (one view, four pages). I want to show these four pages with a moscone layout, having a menu block in the sidebar and the main page conent in the content area.

As far as I understand, the only way to achive this is to
– take the default layout (because I need the "main page conent"-block)
– change the layout template to Moscone
– and allocate the blocks.

This works fine, but
– the changed "Default layout" remains "Default layout" (although storage state is overriden")
– and it applies to all other pages, because there are still no "Layout overrides".

Don't know if I'm missing something, or if there is another way how to be able use the "Main page content"-block on different layouts?

Again, best regards

 

Great, this is exactley what I have been looking for! Works perfectly!

Thank your very much for the hint!

Best regards

I figured out some kind of "work-around": it's using view blocks instead of view pages and configuring four layouts (one layout for each view block), being the selected block the only difference. Hard to believe that this is the "backdrop way". If you or someone else has another idea, please let me know!

Thanks a lot and best regards

Olafski's picture

From my experience, using views block displays (instead of pages) is generally a good fit for Backdrop and its Layout system. I don't know your site, but I think you can achieve your goal with one layout by adding all blocks in that layout, and add a visibility condition to every block.

Thank your very much for this advice, I'll do more testing with both pages and blocks, but for the moment "Layout Wildcards" has solved my issue :-)

Best regards