Copied to clipboard

Flag this post as spam?

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


  • Shola 61 posts 247 karma points
    May 15, 2017 @ 16:56
    Shola
    0

    Include field alias in field CSS class?

    Hello!

    Great plugin--it helped me solve so many issues. I do have a question though:

    In the formulateField directive, your template just outputs the fieldtype for the CSS class. This is fine for some general CSS styling. But for more targeted CSS styling, How about also outputting the field alias too? so instead of just

    class="formulate__field--text"

    It could be something like:

    class="formulate__field--text  formulate__field_alias--firstname"
    

    ..for a "First Name" text field.

    I'm aware there's already a specific field-id attribute outputted, but using that string is not very clean or dependable.

    Thanks!

  • Nicholas Westby 1883 posts 6259 karma points c-trib
    May 15, 2017 @ 17:15
    Nicholas Westby
    0

    Sounds like a good idea for a feature request. Would you mind submitting it here?: https://github.com/rhythmagency/formulate/issues

    Once you do that, I can add some details about where to modify the code. Life is a bit busy at the moment, so I can't promise to get to it soon. However, if you submit a pull request, I'll make sure to create a release soon thereafter.

    By the way, I'd stick with this format: formulate__field-alias--first-name. I call this snake case (though there may be a more accurate name): https://github.com/rhythmagency/rhythm.core/blob/c87e4b350bde79b43e46b3023a99c51c61456d76/src/Rhythm.Core/StringExtensionMethods.cs#L113

  • Shola 61 posts 247 karma points
    May 16, 2017 @ 18:41
    Shola
    1

    Thanks! I appreciate anything you can do when you have the time. I know how busy life can get.

    (Also, I've heard it being called kabob-case, which I've always found equally hilarious and intuitive.)

  • Nicholas Westby 1883 posts 6259 karma points c-trib
    May 16, 2017 @ 18:50
    Nicholas Westby
    0

    Thanks for creating the issue. And yeah, kebob-case is probably the better term :-)

    Here's a link to the issue for reference: https://github.com/rhythmagency/formulate/issues/100

  • Nicholas Westby 1883 posts 6259 karma points c-trib
    May 07, 2018 @ 04:08
    Nicholas Westby
    1

    FYI, this has been implemented and will be included in the next release of Formulate. See the issue linked above for details.

Please Sign in or register to post replies

Write your reply to:

Draft