Hi,
Sometime ago the it was mentioned that we should merge chunks and templates. At the time there was no way to include a template and Travis had already started to merge chunks with Snippets by calling them "HTML Snippets". Today we now can insert a template inside a document using the format [[$TemplateName]]
In addition we can also process a template by passing parameters to it:
[[$MySideBar? &color=`#ffcc00` &font=`verdana,arial`]]
This functionality would make HTML Widgets redundant.
What do you think?
-
MODX Staff
- 12,272 Posts
Static WIdget (chunk)
Dynamic Widget (snippet + plugin)
Formatting Widget (display controls->widget)
Input Widget (input controls->widget)
But they’re all just "variations of a widget" to the newbies. Helpful?
Ryan Thrash, MODX Co-Founder
Follow me on Twitter at @rthrash or catch my occasional unofficial thoughts at thrash.me
I thinking that since we will be allowing users to pass parameters into a template (example [[$MyTemplate? &color=`#ffcc00`]]) then we don’t need Static Widgets. In other words Chunks (aka Static Widgets) will just be seen as a template (or sub-template).
This means that users will use a template to store their html codes the same way they are using chunks now.
This means that there’s no longer a need for Static Widgets.
Wigets - a combination of snippets/plugins (PHP)
Templates - a combination of existing "Templates" and chunk (HTML).
In the case of Templates we don’t need to create any new table as the templates table already exist and will not conflict with the new system.
Hi Adam,
Well it seems you only need to merge snippets and plugins (kinda wish I never separated them in the first)
Okay, but the way I’m doing widgets it’ll actually be very simple to add any sort of Code into them including HTML. We could actually make everything a widget bedind the scenes and separate them out in the frontend.
I also think we need to keep a frontend separation of templates from chunks. Because some chunks really can’t be used as templates and they shouldn’t be clogging up the lists in the document and TV editors.
Quote from: aNoble at Dec 02, 2005, 10:46 AM
I also think we need to keep a frontend separation of templates from chunks. Because some chunks really can’t be used as templates and they shouldn’t be clogging up the lists in the document and TV editors.
Yes there will be a distinction bewteen Page Templates and Content Templates
The thing to note is that Content Templates should not contain <html> tag only codes between <body> tags
Page tags are for full page templates