This RFC requires merge of [RFC] Merge style components
Introduction
With style components separation gone, it might be a good idea to apply template inheritance to everything: templates, css files, javascript. I suggest to add new template instruction: <!-- RESOURCE filename -->
It takes only one parameter: name of file. It might be string, it might be template variable:
Code: Select all
<!-- RESOURCE 'template/mystuff.js' -->
<!-- RESOURCE IMG_LOGO -->
Sample output:
Code: Select all
./styles/whatever/template/mystuff.js
./styles/whatever/theme/images/logo.png
- Allows to apply template inheritance to everything
- No need for variables like S_SUPER_TEMPLATE_PATH to include scripts: if script exists in current style, it will be included. If it doesn't exist, script from parent style will be included
Possible addition
Instead of one parameter, it could take several parameters, separated by spaces. Then all parameters would be merged into one big string before checking for file name. That would allow mixing strings and template variables, like
Code: Select all
<!-- RESOURCE 'images/' forumrow.FORUM_IMAGE '.png' -->
Code: Select all
$resource = 'images/' . $_forumrow_val['FORUM_IMAGE'] . '.png';