The following warnings occurred: | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Warning [2] Undefined array key "avatartype" - Line: 783 - File: global.php PHP 8.1.31 (Linux)
|
Form Constants for use in templates? - Printable Version +- Form Tools (https://forums.formtools.org) +-- Forum: Form Tools (https://forums.formtools.org/forumdisplay.php?fid=1) +--- Forum: General Discussion (https://forums.formtools.org/forumdisplay.php?fid=5) +--- Thread: Form Constants for use in templates? (/showthread.php?tid=1034) |
Form Constants for use in templates? - russellfeeed - Jan 13th, 2011 Hi I'd like to be able to create some values associated with a form. E.g for Form X, I'd like to associate a URL http://www.x.com which I could then reuse in various Emails etc using Smarty. The values is associated with the form, and with a submission, and so I need to be able to edit it when I configure/edit the form (alongside the View, Emails, Fields, Database tabs etc) This may be a feature request, but I'm wondering if anyone has done this or perhaps figured out where to put such constants in a config file somewhere. Thanks Russell To elaborate... this feature comes into its own when used with the Form Backup Module. Many of my forms are the same, but require slight tailoring. e.g. the emails need to have the correct address at the bottom. This would be much easier if I could define constants which could be used in the Smarty email templates, at the form level. Cheers Russell RE: Form Constants for use in templates? - Ben - Jan 18th, 2011 Hi Russell, Sorry for the wait on this! Interesting one... I was *going* to link you to this page, but I see I haven't finished writing it. Ack. Okay, check the link shortly: it explains how to use the Hooks Manager module to create a placeholder for use in your email templates. http://modules.formtools.org/hooks_manager/?page=add_email_template_placeholder However, it's not global - it would just be for use in your email templates, not anywhere else. Unfortunately, defining globals like this isn't really supported yet. But give me another concrete example of how you'd like to use it and I'll see if I can think up a workaround. In the meantime, I'll update that page! [EDIT: all done. Let me know if I'm not clear on any of the steps.] - Ben RE: Form Constants for use in templates? - russellfeeed - Jan 25th, 2011 Thanks Ben I've installed the Hooks Manager and started playing with it. Cheers Russell |