-
Notifications
You must be signed in to change notification settings - Fork 0
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
Question - how can we select layout for specific entry/section? #22
Comments
The sidebar won't show if there are no blocks in it. It is not possible to have different regions per layout, if you need different regions you'll need to create a theme that extends bootstrap theme and override the regions. |
"The sidebar won't show if there are no blocks in it." "It is not possible to have different regions per layout, if you need different regions you'll need to create a theme that extends bootstrap theme and override the regions." Is it possible? We can create custom layouts, so i assumed that these custom layouts could be used somehow. |
So your other layout can have different blocks, you can copy the default layout for that specific entry and change the blocks. If you need a specific blocks for a url that is not a category or an entry, then you can create a custom layout. You can change the displays for each layout also. Anything else will need to be changed in the template. You can override the displays/region/block template for any entry for example : https://github.com/ryssbowh/craft-themes/wiki/Developers#entry-layouts If you have a section
The default template being here : https://github.com/ryssbowh/craft-themes/blob/master/src/templates/front/layouts/layout.twig Or if it's a region (for example
The default template being there : https://github.com/ryssbowh/craft-themes/blob/master/src/templates/front/regions/region.twig All those templates will be listed on the frontend as HTML comments if you enable the templates suggestions : https://github.com/ryssbowh/craft-themes/wiki/Usage#user-preferences-pro |
"So your other layout can have different blocks, you can copy the default layout for that specific entry and change the blocks. If you need a specific blocks for a url that is not a category or an entry, then you can create a custom layout."
This means that before header region is defined "globally", not for any specific layouts, but for all of them, existing in this theme. It will exist in every layout, yes? Next you described how we can overwrite various objects using template files - thanks for that, but i was thinking about something different. Now we are venturing into vague proposals teritory, but i was thinking about defining layouts with DIFFERENT REGIONS, not just with different blocks set in these regions. This would probably require rewriting parts of code base, but when we take
This would generate multiple two layout builders, one displaying region sidebar, one not. And end-user would be able to select for example if section "blog" uses layout with sidebar, or not. |
I see, |
Lets take bootstrap theme - it has default layout with sidebar. But i would also like to have for example layout without sidebar.
Is it possible to select layout for specific entry? Or for whole section/entry type?
If yes, how do you do that?
The text was updated successfully, but these errors were encountered: