-
Notifications
You must be signed in to change notification settings - Fork 9
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Template variable substitution for custom input template #13
Comments
I think I can add this into next version too, but please clarify little bit: what is desired input in your .json and what is desired output? (can we keep both current functionality and your proposed with external template?). BTW, I'm always open for enhancement suggestions - thank you. Feel free to add issue for each and mark as "enhancement". About terminology - there is a lot of confusing terms (especially now with react - "kitchen component" vs "react component" (should be "kitchen widget" or something different than component)... but there is a lot of other things to do (day is only 24 hours long here :D ) |
ScopeWhat i'm trying to do is implement a delegating Kitchen Template to pick up the rendering in a Meteor Template. Thus i need basically all the Problem at handIn this specific problem i just need to pass the value as a template argument At the moment
While So i would need this More general solutions?
EDIT: The best solution for me would be to have a field where i could just tell kitchen what template to use for rendering the field EDIT 2 😃 So now you revealed what planet you are from. 24h - pah.... 😃 |
So more succinct what i missed in the previous post. Perhaps the variables should as a rule contain unescaped template variables & literals .
Also sometimes you want |
Ah, now I understand... OK, I'll see what can I do. BTW, there is kitchen "plugin" system. You can create your "plugin.js" file, and when kitchen is generating the app, it executes "node plugin.js" and passes object from input .json as argument. Inside this file, your responsibility is to create .html and .js code (however you want - load template from file, modify it based on component .json from input file or whatever), and store them into variable. Then, generator uses your .html and .js and inserts them into proper page(s). See example plugins. This way, you can build components and use them in the same way as built-in components. This "plugin system" is not perfectly implemented but can be useful. Idea is to make central plugin repository (similar to atmosphere or npm) - so people can share their plugins... but that maybe if I move to planet Venus (day is much-much longer there!). :) |
Yes, but i wanted to avoid taking over the whole form, when i just needed a field Customisation. In the end I wrote the page template, and that is my Meteor Template hook point. |
OK, I understand. 👍 |
Would it be possible that you also pick up on Two JSON fields at the app level
would also clarify what is now implicit. Also some fields (i can't remember which) actually require that you add the extension to the JSON property value (e.g. "template.html") while others like EDIT: actually this would only be feasible on a per plugin basis, otherwhise - like in this Issue's case- html and jade would be mixed. |
Hey, maybe this helps: https://github.com/perak/kitchen-custom-form-field |
Sorry i'm a bit |
Hi,
When using the
field.input_template
option, the value substituted forFIELD_VALUE
is escaped by{{}}
Unfortunately i cannot use that value as a template argument, as this breaks:
I am trying to delegate the rendering of this to my external package, thus i would need access to the unescaped form.
I could unescape it in the
.js
code and then do some eval in a helper, but that seems rather hackish, given that it's not a general rule for template variable replacements to be escaped.I also have some ideas for more small changes that would help greatly in delegating functionality, but i don't know if this is the right place for those. Do you plan to open a general enhancement issue?
Ah and one more thing if you don't mind:). The overall use of the term Template was a bit confusing for me when getting started and to an extent it still is, as there are Meteor Templates and Meteor Kitchen Templates.
Thank you for your initiative with meteorkitchen.com, it speeds up the setup of a project and i really appreciate the effort you put into it!
The text was updated successfully, but these errors were encountered: