Since the events and parser are inextricably linked for the most part, I’m moving this discussion here:
Implementing it all
The above is not definitive. We hope be able to make the parser consist of one recursive preg_match (or whatever) on nestable [[ tags with a separate pass for non-cached objects. The revsised syntax follows, which would allow for things like [[widget? &color=`[[*colors]]` &foo=`[[blah? &bar=`[[blahblah]]` ]]` ]] to work.
This would all be done in hopes of optimizing the performance and flexibility of the document parser via fewer loops to go through, and using function callbacks vs. case/switch statements. It would also hopefully provide for:
- all objects being cachable or non-cachable
- all objects being nestable
Here’s how to translate the current methods into the proposed new way:
- [[widget]] = [[snippet]] or {{chunk}} with a static/dynamic flag, plus a caching flag, eliminating the requirement to configure caching parameters via [!snippet!]
- [[~linkID]] = [~linkID~]
- [[+placehoder]] = [+placeholder+]
- [[++system_setting]] = a system placeholder with namespace uniqueness [(site_setting)]
- [[*contentField]] = Template Variable [*tv*]
- [[*#contentField]] = QuickEdit enabled content field [*#tv-or-content*]
- [[^parse_time]] = also time, date, size for current date/time and bytes of code (HTML text only... no includes or linked files/images) sent to the browser [[^timing^]]
Here’s some completely new/majorly enhanced constructs:
- [[$template]] = insesrts a template or sub-template in the page (n/a previously)
- [[%language]] = way to handle multi-lingual sites, to be addressed eventually (n/a previously)
- [[@onEventName]] = used to raise an event from within the page and allows for calling / invoking custom or system events. For example: [[@OnRenderRichText? &editor=`FCKEditor` &elements=`mytextarea`]] will invoke the RTE plugins and render the RTE on the page, replacing the textarea of ID=mytextarea with the FCKEditor instance, or [[@OnBackupInit]] could be used to trigger a backup whenever a page is viewed
- [!anything!] = for developers who want to maintain/override caching on any of the above items [!snippet!] (and previously limited only to snippets)
The following modifiers are what makes fair game sense to use:
~ ! @ $ % ^ *# _ - + = { } .
The following don’t to me due to logic/code/html associations/implications:
The # is obviously used by QuickEdit, which needs to be considered in the switch handling, obviously. The ! could also be used to denote inline cache disabling as needed: [[!non-cachable-snipet-call]], but more discussion is needed on this as to how it would affect execution times and overall architecture.