We do not offer APIs or any simple way to add attributes to some of the base HTML elements (<html>
and <body>
being the common ones you'd want to target), meaning you're left to a onAfterRender
plugin event to manipulate the fully compiled HTML or JavaScript manipulating the DOM. We can do better.
Labels |
Added:
?
|
The <jdoc>
tags should be left to full sections of HTML, not for elements of a single tag. That's a no-go by me.
If the regex solution is what we're offering then this might as well be closed out, that's exactly what onAfterRender
offers now.
It shouldn't be that hard to come up with hooks to add this data then echo it similar to WordPress' body_class()
or language_attributes()
functions. Ya it's reliant on the template implementing support for those features, but everything HTML related is reliant on the template honestly (imagine one that excludes the component <jdoc>
tag then people wondering why they're missing stuff). You're right about Joomla not controlling these elements, but we can give APIs to folks and reasons for the template devs to adapt quickly.
The tags should be left to full sections of HTML, not for elements of a single tag. That's a no-go by me.
If the regex solution is what we're offering then this might as well be closed out, that's exactly what onAfterRender offers now.
I do agree on both! I just responded with the easy quick/dirty fixes. Do you expect this to land in 3.x?
I doubt it will because I doubt many will have the patience to write up that part of the API and the ones that might are already overworked. But it should land somewhere, preferably this decade.
Yeah, maybe together with the js abstraction layer...
Category | ⇒ | Libraries |
Status | New | ⇒ | Discussion |
Labels |
Added:
J3 Issue
|
This'll never happen.
Status | Discussion | ⇒ | Closed |
Closed_Date | 0000-00-00 00:00:00 | ⇒ | 2018-04-03 12:05:47 |
Closed_By | ⇒ | mbabker | |
Labels |
Removed:
J3 Issue
|
Joomla doesn't control those elements in the core, everything is up to the template. So I see two possible solutions here:
<jdoc:include type="html" />
and<jdoc:include type="body" />
(I don't like doc)