Closed julianlam closed 10 years ago
Yes the last part is key. Since when did you start writing essays for issues? owait :D
haha alright :+1: -- the sooner you do it the better, afaik nobody uses widget areas in themes except us, so we can deprecate it without notice.
The challenging part is pulling widget info out of the templates
The reason why I bring this up is because creating child themes doesn't bring the widget areas over
Equal issue for JS files being brought over to child theme (ex. imagine Vanilla included a bunch of JS files for modifying stuff - Lavender as a child theme would require all those JS files too).
So if this is your primary concern this issue should be refiled as something higher up (ex. "Child themes should inherit Parent theme's plugin.json IF none is specified").
Closing this because reading widget area data from tpls isn't practical from what I tried.
Just a question for @psychobunny, would it be possible for widget areas to be defined entirely in a theme's template files?
Seems the minimum required is this js:
and this html:
Could it be reduced to:
<div widget-area-id="content" widget-area-name="Homepage Content">
. with thetemplate
argument inferred from the template file itself?The reason why I bring this up is because creating child themes doesn't bring the widget areas over, so it's impossible for me to have a child theme with my own widget areas and inherit the widget areas already present in vanilla.
You might think "but vanilla's templates can be overwritten by template files in your theme", which is exactly why we'd detect widget areas on load, thus getting a proper set of widget areas based on which ones are actually present in the template files.
I imagine using something like
grep
to look for the widget codes during NodeBB startup (incompileTemplates
) might be it.