ui icon indicating copy to clipboard operation
ui copied to clipboard

Some templates are missing common properties like id

Open mvorisek opened this issue 4 years ago • 5 comments

Templates like admin.html/pug are missing id property.

Is that intentional?

Element properties like id, data, ... has almost nothing to do with styling and if user/programmer wants to add them, it should be always possible no matter if defined in the template or not.

This is a feature request to introduce some special template parameter like {$implicit_props} which can be easily added to all templates and then the common html properties can be added with one centralized code from View. Another option might be to always parse the template and set the common properties by DOM (which is not easy, as templates might not be always be valid html).

mvorisek avatar Mar 29 '20 22:03 mvorisek

Some of those properties were added on “need to” basis.

romaninsh avatar Mar 31 '20 05:03 romaninsh

Also it's possible that some templates do not need these id because they are not used there or template is part of another template.

DarkSide666 avatar Mar 31 '20 17:03 DarkSide666

@DarkSide666 I spotted this when I needed to work with main layout - there is no id and also jQuery without custom selector did not worked, as the id does not exist and can not be currently added.

Quite legit use case.

mvorisek avatar Mar 31 '20 17:03 mvorisek

Yes sure. I'm not against it. We should add {$_id} in all of them.

DarkSide666 avatar Mar 31 '20 18:03 DarkSide666

templates should be redesigned to be parsed into DOM - we can then manupulate the DOM in init as needed then

mvorisek avatar Jun 08 '20 23:06 mvorisek