Copied to clipboard

Flag this post as spam?

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


  • denmch 2 posts 72 karma points
    Sep 21, 2017 @ 18:38
    denmch
    0

    Grid settings: allow editors to add data attributes

    I'm using Umbraco grid and would like to add data attributes from the back office without having to predefine them and add an arbitrary value. It doesn't look like this is possible, but I thought it worth checking.

    Here's an example. We're using Foundation 6, and often want to use Foundation Equalizer to set equal height among columns. The data attributes are data-equalizer on the parent and data-equalizer-watch on those children that should receive equal height. These do not require values, but in order to use them, I currently have custom properties for each attribute in grid settings with view set as textstring. In order to add the attribute, I type true, which isn't required for the attribute, but is acceptable.

    I'd like to use a simple input where I can type any number of attributes, with or without values rather than define a key and specify a view.

    If that's not possible then it seems the only alternative is to add each data attribute that I might require (e.g., occasional modifications to Equalizer like data-equalize-on-stack='true'), and then adding others to grid settings later as they're required, requiring a pull request and deployment (lest they be overwritten) simply to add a data-attribute, and cluttering the settings for each grid.

    Thanks for your time.

  • Marc Goodson 2122 posts 14213 karma points MVP 8x c-trib
    Sep 22, 2017 @ 09:07
    Marc Goodson
    1

    Hi denmch

    There is an issue on the issue tracker regarding adding custom css classes to grid cells, when you define the cells here:

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

    would be good if you could add the info about data-equalizer here, in case someone picks up this issue to resolve, currently there is a pull request that adds the textbox as you describe to add additional css classes:

    https://github.com/umbraco/Umbraco-CMS/pull/678

    maybe this would be the inspiration for a general textbox for data attributes?

    regards

    marc

Please Sign in or register to post replies

Write your reply to:

Draft