Skip to Main Content
Res facta quae tamen fingi potuit (
2011-09-21 09:13 pm (UTC)
You can't call Perl code directly from templates, so you have 2 solutions, I think:
- have your controller pass variables to your template indicating which beta features the user has turned on. Then you can do something like [% IF uaerhasbeta.featurename %] [% dw.need_res( 'js/featurename.js' ) %] [% ENDIF %] (syntax not guaranteed)
- write a TT plugin (see cgi-bin/DW/Template/Plugin.pm and cgi-bin/DW/Template/Plugin/*) (being vague here, because I'm unsure of my footing)
Which is best depends on how many templates would need to test for beta features and whether this change is strictly localized to the templates, or if it affects the controllers as well.
Reply to this
Thread from start
Post a comment in response:
This account has disabled anonymous posting.
You can comment on this post while signed in with an account from many other sites, once you have confirmed your email address.
Sign in using OpenID
If you don't have an account you can
create one now
HTML doesn't work in the subject.
Check spelling during preview
This account is set to log the IP addresses of everyone who comments.
Links will be displayed as unclickable URLs to help prevent spam.
Log in with OpenID?
Forget your password?
Site and Journal Search
Buy Dreamwidth Services
Gift a Random User
Site and Account