What is wrong with this SmartyTemplate code?
{IF $plan.code|strpos:'pc-' ==FALSE}
Show this only if the plan.code Contains "pc-"
{/IF}
Discussions are closed to public comments.
If you need help with Cheddar please
start a new discussion.
Keyboard shortcuts
Generic
? | Show this help |
---|---|
ESC | Blurs the current field |
Comment Form
r | Focus the comment reply box |
---|---|
^ + ↩ | Submit the comment |
You can use Command ⌘
instead of Control ^
on Mac
1 Posted by Credentials-NOC... on Jan 19, 2015 @ 07:37 AM
When I try to SAVE that template I get a general error (sorry, forgot the error #).
I assume I have a syntax error.
Support Staff 2 Posted by Marc Guyer on Jan 19, 2015 @ 03:17 PM
I'm not sure. Can you give me more detail on the error message? What's the exact time the error was generated?
Support Staff 3 Posted by Marc Guyer on Jan 19, 2015 @ 03:17 PM
Also, which product are you testing this on?
4 Posted by Credentials-NOC... on Jan 19, 2015 @ 04:45 PM
product:: speech & language Exercises
plan: (probably doesn't matter since it would apply to all plans)
but Plan code: Morespeech.com
plan name: MoreSpeech.com
error: 500: An unexpected error occured. Please try again later.
Alternative solution:
is there an alterernative comparison (besides == or eq) that checks for $A contains $B (case insensensive)
Support Staff 5 Posted by Marc Guyer on Jan 19, 2015 @ 09:27 PM
Smarty reports that our security settings do not allow the
strpos
function. By default, the security settings are very restrictive. I'm not sure it's necessary to disallow the use ofstrpos
. We've have to have the dev team evaluate and whitelist this function. Off the top of my head, I don't see a workaround.6 Posted by Credentials-NOC... on Jan 20, 2015 @ 12:01 PM
And, just to be clear, I want the Case Insensitive version (Stripos).
(Althought strpos would work in a pinch)
7 Posted by Credentials-NOC... on Jan 22, 2015 @ 05:28 PM
Any news on this"?
Support Staff 8 Posted by Marc Guyer on Apr 22, 2015 @ 06:02 PM
The stripos function is now available with the email template system overhaul. Let us know how that works out for you. Thanks for the suggestion!
Marc Guyer closed this discussion on Apr 22, 2015 @ 06:02 PM.
Marc Guyer closed this discussion on Jun 02, 2015 @ 02:46 PM.