Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • George Phillipson 87 posts 236 karma points
    Sep 28, 2017 @ 20:15
    George Phillipson
    0

    Bootstrap css cols in Umbraco grid editor

    Hi

    This may seem like a daft question, how do you add extra css classes to the Umbraco grid.

    The only way I could do it was to remove:

    <div class="col-md-@s,grid column">
    

    from bootstrap3.cshtml.

    Then in the developer for the grid add a textbox and then add the classes I wanted.

    Any other way would result in a new div been created inside

    <div class="col-md-@s,grid column">
    

    This does not seem right, so any advice would be appreciated

    George

  • Marc Goodson 1451 posts 9716 karma points MVP 5x c-trib
    Sep 30, 2017 @ 13:40
    Marc Goodson
    0

    Hi

    There is an open issue on the tracker regarding this:

    http://issues.umbraco.org/issue/U4-6585

    feel free to vote up and comment there.

    There is a 'fix' on that to provide an additional css classes textbox for each grid cell when you design a row.

    The alternatives are to:

    1) Write a custom grid renderer (start by copying the bootstrap one (/views/partials/grid/bootstrap3.cshtml) and then target the alias of the row that requires the additional classes, and add them in just after the col-md-@s class) - When writing out the Grid in your template, you pass the name of your custom renderer as an additional parameter.

    2) do as I think you have done, which is add a class textbox or radiobutton list custom setting, and have the editor add the appropriate additional class via the grid cell settings.

    https://our.umbraco.org/documentation/getting-started/backoffice/property-editors/built-in-property-editors/Grid-Layout/Settings-and-styles

    (the new blueprinting functionality of 7.7 might let you set up a blueprint with all the correct css classes in place)

    regards

    Marc

  • George Phillipson 87 posts 236 karma points
    Oct 04, 2017 @ 21:58
    George Phillipson
    0

    Hi Mark Thanks for the reply, I have done 2. Regards George

  • This forum is in read-only mode while we transition to the new forum.

    You can continue this topic on the new forum by tapping the "Continue discussion" link below.

Please Sign in or register to post replies