I can't seem to find when the class="container" is auto generated with my grid layout, as my page size is a bit too small to contain the content that i want.
As seen on the picture, the highlighted line is the class that i want to add a custom css for, to control the width of my content.
Grid Layout container class
Hello,
I can't seem to find when the class="container" is auto generated with my grid layout, as my page size is a bit too small to contain the content that i want.
As seen on the picture, the highlighted line is the class that i want to add a custom css for, to control the width of my content.
any ideas where it would be located?
Hi Lasse,
You can find the rendering of the grid layout in this folder of your website : / /Views/Partials/Grid
You will see several razor views there. By default the grid uses Bootstrap3.cshtml
Looking at the code it seems this get added when a row has more than one column.
You can change this view. But to be safe with upgrades I would create my own view.
And when you created your own view you can use it for rendering the grid by passing the name to the method you are using to render the grid : https://our.umbraco.com/documentation/Getting-Started/Backoffice/Property-Editors/Built-in-Property-Editors/Grid-Layout/Render-Grid-In-Template#using-htmlgetgridhtml
Dave
Hey dave,
I found the file and verified it.
I have a follow up question if you got time
Is it possible to make it change class to something else, if a specific template type is used?
like if a page is of a specific template type e.g. could be protected like a login screen. then it changes the class for those pages
Hi Lasse,
In that view you have access to the current page through
Umbraco.AssignedContentItem
So you can get the documenttype alias like this
Or the template alias like this
Dave
Hi dave,
thanks for your time, it works perfectly
is working on a reply...