New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add the main page content block to layouts that do not have "main page content" #2636
Comments
I guess, there is no context for it. Nothing to show. |
Yeah, that makes sense. |
Hm, why there is no Main page content block in the Sutro layout? There is area CONTENT but there is no Main page content block for this area. |
@bd0bd Sutro is a layout template. Which layout are you trying to apply it to? ...if it is the "Home page" layout, then see @Al-Rozhkov answer above ^^ |
@bd0bd It's confusing, but when you add a custom layout using a node/[nid] path like that, it doesn't work the way you expect. In general, any layout that has a non-wildcard path will not have a "content" block as there's no place for the content to come from (just like in your home page layout). When you create a custom layout using node/5 as the path, you are completely circumventing the system's built-in way of handling the "node/5" path, which actually makes the node content inaccessible -- not what you want. Instead, configure the Contact layout to have "node/%" as the path, and "Node NID is 5" as a visibility condition. That way the system will still go through its normal process for loading node/[nid] content, and you'll have a content block available in your layout. |
Thank you very much! 👍 |
Ya, this trips me up too sometimes and the only I was going to remember was to type it up myself... thanks to @quicksketch for original explanation in #735. |
What if we automatically fixed this for the user? Meaning if a user types in Any downside? @jenlampton? |
That sounds awesome :) Can we add a condition for We should also add a message saying "A condition has been added for this layout to match the path you entered" so that people don't think it's a bug. But yes, a big +1 for this!! |
Please somebody native english speakers specify better title, I'm struggling to formulate it :) It is also become a feature request. |
This issue was closed and then reopened with the suggestion 3 comments up. I don't think that the title of this issue is very helpful (anymore) and I don't understand the suggestion that @docwilmot made enough to edit the title myself. Any help? Is this related to: #3750 - Layouts: Add support for custom contexts |
Layout provides the Main content block only if that layout is overriding an existing path (a path that is in a
No module provides a path My comment there had nothing to do with the original title sorry, was just a response to #2636 (comment) To fix this issue, and provide the MCB on the home layout, I suppose we could add a "home" path entry to |
@docwilmot perhaps you are the most appropriate person to answer this: I see that the blocks defined by the Dashboard module via When I try to edit the contexts of the home layout via the admin UI, this is what I am given as options: So, do I need to programmatically create a new, custom layout context Thanks Side-question: why isn't the |
Just out of curiosity, I replaced the |
The |
@klonos, from your question 3 comments up, should there be a new issue like "Make blocks defined by Dashboard module available to any layout?" 'Cuz it seems like it's easily done if there's a need. |
Not sure if all Dashboard-provided blocks would make sense being added anywhere else other than the Dashboard layout, but the reason for my comment above was that I had the need to be able to add a specific Dashboard block to the home layout. |
Sorry missed the mention here. We left off dashboard from the list of available contexts, for no proper reason whatsoever. That context should be available to any other layout, you're right, since we discussed, when planning the dashboard, that users should be able to use another layout as their own dashboard. In fact in As it is now though, the only way dashboard context is available to any layout is by path, unfortunately, specifically So short term, dont think this is doable without hacking. Long term we should:
|
Thanks for the insight/summary @docwilmot 🙏🏼 Would you like me to create a separate issue for all that? |
I'm not sure we should change this behavior. If we provide a "main page content" block on a page that has no main page content, then that block would print nothing, so it would not show up at all. This might create an even more confusing experience than not being able to add the empty block to the page. I've created #5539 to address the issue of what happens when people create the wrong type of layout by accident. |
Main page content block not available for the Home page layout.
Why is that?
The text was updated successfully, but these errors were encountered: