Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Some templates are missing common properties like id #1028

Closed
mvorisek opened this issue Mar 29, 2020 · 5 comments · Fixed by #1979
Closed

Some templates are missing common properties like id #1028

mvorisek opened this issue Mar 29, 2020 · 5 comments · Fixed by #1979
Assignees
Labels

Comments

@mvorisek
Copy link
Member

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).

@romaninsh
Copy link
Member

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

@DarkSide666
Copy link
Member

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.

@mvorisek
Copy link
Member Author

@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.

@DarkSide666
Copy link
Member

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

@mvorisek mvorisek self-assigned this Jun 8, 2020
@mvorisek
Copy link
Member Author

mvorisek commented Jun 8, 2020

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants