Open Power Template 2.x family
PLEASE PROVIDE THE TEMPLATES AND/OR PHP CODE IN THE TASK DESCRIPTION (Not URL-s to them). THAT ALLOWS US TO REPRODUCE THE PROBLEM! OTHERWISE WE ARE NOT ABLE TO HELP YOU!
Remember to hide all the security-related pieces of code from the task description, like passwords, server paths etc. for your own safety. Once we close the task, we cannot edit it anymore!
PLEASE PROVIDE THE TEMPLATES AND/OR PHP CODE IN THE TASK DESCRIPTION (Not URL-s to them). THAT ALLOWS US TO REPRODUCE THE PROBLEM! OTHERWISE WE ARE NOT ABLE TO HELP YOU!
Remember to hide all the security-related pieces of code from the task description, like passwords, server paths etc. for your own safety. Once we close the task, we cannot edit it anymore!
FS#95 - For OPT V3 - Combination of Snippets (performance) and includes (nice handling)
Attached to Project:
Open Power Template
Opened by Skruppy (Skrupellos) - Monday, 13 July 2009, 13:21 GMT-8
Last edited by Zyx (Zyx) - Thursday, 15 April 2010, 02:48 GMT-8
Opened by Skruppy (Skrupellos) - Monday, 13 July 2009, 13:21 GMT-8
Last edited by Zyx (Zyx) - Thursday, 15 April 2010, 02:48 GMT-8
|
DetailsUp to now it is possible to dynamically include a whole file (with "opt:include"). This enables me to add some parameters in the opt:include tag or/and to import all parameters. opt:insert enables me to statically include a snippet. Here, I can't directly add some parameters and furthermore, the snipplet can see and change all variables of the including template.
With opt:include, there is also a performance problem. If you include more than 50 templates with some static strings as parameters, you have to create 50 Objects, copy literals to variables and do some template management. To save this overhead, I could copy and paste the template and replace all variables (this would be the manual way xD). My idea is to combine opt:include and opt:insert. The resulting instruction could determine whether or not to "copy and paste" (like opt:insert) or dynamically include (like opt:include) the template/snippet by the file/snippet parameter (is it dynamic (parse:) or not(str:)). Snippets and files are both XML-Trees, the only difference is the declaration position (external file or inside a file). This means that you have to extract snippets to external files (for dynamic inclusion) and "copy and paste" template files for static inclusion. if you statically include a template, you have to substitute variable names with the expression in the parameters. unknown variable names have to be replaced (or something like that) to prevent collisions with "outside"-variable names. To import all "outside"-variables at once you could use a parameter like "import=yes" (of course, this is not exactly the same behavior like the opt:include import). |
This task depends upon
Closed by Zyx (Zyx)
Thursday, 15 April 2010, 02:48 GMT-8
Reason for closing: Implemented
Additional comments about closing: Implemented (procedures) in OPT 2.1
Thursday, 15 April 2010, 02:48 GMT-8
Reason for closing: Implemented
Additional comments about closing: Implemented (procedures) in OPT 2.1