I'm new to Backdrop and i'm a little bit lost.  I've watched videos and read all I can about pages and layouts.  What I don't understand how to do is when creating a new page how do I set it up to utilize a layout?  I don't see the fields to do this with even after all the videos and articles i've read. They've all described the relationships between the content and the layout, but none have said "enter X into Y".  As with any CMS, I understand there is a bit of a learning curve but this just isn't clicking for me.

 

I'd appreciate it if someone could provide me these details or refer me to an article/video that addresses this.

Accepted answer

I don't think you need the visibility condition that just replicates the path field.

 Other than that, then yes, that should work. If you want to tailor blocks as you indicated you might want to, you can add visibility conditions to individual blocks as needed

Comments

Hi @Rob_V - In the layout you want, you need to create a visibility condition, either for a single path, multiple paths or for a pattern of path.

As an example, let's say you want a layout to be used for all blog posts.  You create a content type of blog and set the path to automatically start with "blog/" followed by a unique combination.

You then create a visibility condition of "blog/*" for that layout and it should apply to all those pages.

You can specify a layout to apply to specific paths as well.

So then on the page content I would add a condition in the URL Alias field under URL Settings?

The visibility condition is in the layout configuration (Structure > layouts)

layouts

In Structure > Content types > Page [or whichever content type you want to use] you can set a default URL alias pattern using tokens.

The URL alias field in page content allows you to override the url alias pattern if you need to.

If you're able to explain whether you're wanting to do on just a single node or whether its across a content type, we can give you more specific direction.

Thank you for your responses. 

I want to create pages and then be able to edit the blocks on those pages with different content.  There may be some pages with the similar block configurations but I expect that not to be the norm.

 

What it sounds like you need is block visibility within a layout.

Let's say you're using the default layout.  Go to manage blocks.  Add all the blocks you might need and then add visibility conditions that looks similar to what you see in layout visibility conditions, but its on the block level.

 

Hmm.  I see.  So to take a step back...

I have a layout with the path at ....Page/%.  I then added a visibility condition set to URL Path.  In the Paths field, I entered "page/%".

Content Type : Page.       In the URL Alias Pattern field, I entered "page/[node:title]".

When I created a new page, if I don't change the URL Settings it should then use the page/% layout page.  Correct?

I don't think you need the visibility condition that just replicates the path field.

 Other than that, then yes, that should work. If you want to tailor blocks as you indicated you might want to, you can add visibility conditions to individual blocks as needed

I must be missing something because my pages are pulling from Default instead of the Pages layout I created.  Is there any way you could indicate which fields have to "match" and the settings in order for the page to utilize the correct layout?  I think i'm missing something small.

 

Thanks again for all of your help so far!

I apologise; I think I've told you slightly wrong.  Most stuff is right but the path field should be more related to the system path so for any content types it will be node/%

Your visibility condition will use the path:

page/*

Note path field and visibility condition have different wildcards

Hi @Rob_V - did the last comment help?  If you're still struggling, the Backdrop community runs 'Office Hours' every Wednesday (i.e. including today) from 19:00 -21:00 UTC where someone will be able to help with your issue. 

Hey @yorkshirepudding.  Life has got in the way a little bit.  I'll give your suggestions a shot in the next day or two and will let you know.  Thank you for following up and your patience.

 

Rob

Eureka!  These changes made the difference.  So i'm guessing that generally speaking, I should use node/% on all layout paths.  The Visibility condition is what's going to differentiate the layouts between various pages, correct?

 

I apologise; I think I've told you slightly wrong.  Most stuff is right but the path field should be more related to the system path so for any content types it will be node/%

Your visibility condition will use the path:

page/*

Note path field and visibility condition have different wildcards

Yes, I think that would be any layout paths relating to content types.  According to the on-page help when you create a new layout, the following apply for layouts relates to other entities:

Some common examples of placeholders include:

  • Content: node/%
  • User accounts: user/%
  • Taxonomy terms: taxonomy/term/%
  • Comments: comment/%

If you're sticking with content types, then yes it would be node/%