kalamuna / kalastatic

:electric_plug: Facilitate the front-end experience through Styleguides and Prototypes
https://kalamuna.github.io/kalastatic/
41 stars 14 forks source link

Add "Attributes" class to Twig.js and KalaStatic #473

Open soniktrooth opened 7 years ago

soniktrooth commented 7 years ago

Drupal does lots of nice things when it comes to handling attributes. It would be great to bring this to Kalastatic so that 1. we can use it and it's super handy and 2. we can have feature parity.

https://www.drupal.org/docs/8/theming-drupal-8/using-attributes-in-templates

thiagodemellobueno commented 7 years ago

theres a tiny bit of this happening of late already, yes no? is this a documentation thing? more about how we structure our json and templates? or is there something rob needs to do here?

soniktrooth commented 7 years ago

I'm not sure what you mean by 'a tiny bit of this is happening'. We have some of Drupal's Twig filters in KS which is great but this is different. It seems the attributes object is special and has a bunch of methods for dealing with attributes but the main upside is being able to print {{ attributes }} without have to do nested loops inside the template to print out a multidimensional array.

RobLoach commented 7 years ago

https://github.com/kalamuna/twig-drupal-filters/issues/6

RobLoach commented 6 years ago

https://github.com/ericmorand/drupal-attribute

soniktrooth commented 6 years ago

YASSSSS

hawkeyetwolf commented 6 years ago

lol, from the drupal-attribute project README:

Why would I need this?

If you're wondering, you probably don't need this.

soniktrooth commented 6 years ago

https://github.com/aleksip/plugin-data-transform

RobLoach commented 4 years ago

@HakS done did it!!! https://www.npmjs.com/package/metalsmith-drupal-attribute-twig