Copied from Gitter chat:

@jeffporten_twitter: I have a View block pulling from a database that's called in a layout. Works fine when the layout path is /about/board and that's where the link goes, but I want it to be a regular page with a comments thread. Thought the way to do this was to make the layout path /about/board/% and the page live at /about/board/members, but that's not doing it. Context is set to Content (node).

@jenlampton:

@jeffporten_twitter do you have a node type with comments enabled already?


If so, you could override the display of one of those nodes, and place the view onto it.


or, you could place that same view into the default layout with a visibility condition of path = node/NID

@jeffporten_twitter:

Settings are such that any new Page has a comments thread, visible only to certain roles. (I'm using Page comments as the discussion for the staging reviewers, if anyone wants to talk about a particular page's text or UI.) I am having a bit of trouble wrapping my head around the layouts metaphor, as in my world a layout is something that does not exist until it's applied to something like a page—so I was surprised when I found that a layout with a hardcoded path Just Works there. Also means that I'm not getting how to apply a layout to other nodes.

"Override the display of one of those nodes" sounds like a good idea, and as a newbie I need you to explain that in small words. I looked around various options for a given page earlier today, and couldn't find a way to assign a new layout to one.

 

Accepted answer

Okay, got it! node/% as the path and /about/board/members as the visibility condition (an alias for node/32), I get the page I want with the block in the right place.

Will re-up my prior comment asking about layout switching for all authenticated users, which I don't think has been approved yet.

Comments

Will add: have used the default layout/node visibility trick elsewhere, and concerned that if I overuse this I'll end up with a default layout littered with 1,000 blocks, only 3 of which show on any given page. Would prefer the default template actually _be_ the default and have separate layouts for the pages that need them, nicely labelled.

One more question that's apropos for this thread. I'm thinking about using layout visibility rules to use Moscone Flipped for anonymous users, and Taylor for authenticated users. That way, there's an additional sidebar on the right, which I can reserve for members-only blocks and navigation. Docs explain that there's an ordering in Layouts that determines what people see, which I assume I can figure out when I get there if visibility doesn't do it entirely.

What's unclear to me:

  1. I would like to have the Taylor layout inherit the Moscone Flipped layout for the regions that can be mapped 1-to-1, so if I change the Default layout I don't need to remember to do that for Taylor pages. Seems like this is not possible?
  2. Given the problems I'm having changing layouts for a single page, I'm guessing I need dead simple instructions for how to do a different default layout that applies to an entire set of pages. Is it as simple as creating visibility filters based on User status? I'm not sure how to put the layout path wildcard in such that it applies to the entire site, unless that's just a % character.
  3. Finally: since some pages will have custom layouts as per the above, and I guess the Home page is also in this category, does that mean I have to maintain an entirely separate set of layouts with 1-to-1 matches for authenticated users? Doable but more than I'd prefer to manage.

@jeffporten - I'm not sure I understand your question 100%, but here is my attempt to be helpful:

1) I do not think it is possible to inherit settings from one layout to another . If you create two different layouts, one for anonymous users and another for authenticated using a different templates, I don't know of any way to inherit or pass regions between them. I think you will have to configure them each on their own. 

BUT, I would think it should be possible to simply use Taylor for both groups and set the visibility for special blocks in the authenticated user column/region. Ideally, the content would expand when one region is empty. 

IF that is not possible, you could create your own version of the Taylor template that does expand when a column is empty (or check for a contrib layout that does that). 

2) The default layout will apply to all pages on the site that do NOT have another layout that overrides it. You can replace the default layout for all pages and then simply add custom layouts for any specific paths that you want to override the default layout.

3) I am hoping that #1 and #2 help answer this question.

Aha! Yes, Taylor everywhere makes the most sense. I'll give that a whirl and see what happens.

From the documentation:

2. Give your page layout a name, select the layout template from the list provided, enter in the path of the existing page you want to override.

3. Add visibility conditions to target only your desired page(s), for example:

When I put in the path of an existing page, I get this error: That path is currently assigned to be an alias for "node/32". Delete the alias first, then save this layout.

After some toying with the form submission, a dialog box came back saying to use a wildcard in the path and a specific path in the visibility conditions, so I tried "about/board/%" in the path and "about/board/members" in the visibility condition. No change. Also tried targeting node/32 with no luck, in case aliases aren't supposed to work here. 

Okay, got it! node/% as the path and /about/board/members as the visibility condition (an alias for node/32), I get the page I want with the block in the right place.

Will re-up my prior comment asking about layout switching for all authenticated users, which I don't think has been approved yet.