What is wrong with this SmartyTemplate code?

Credentials-NOChange ForWebAccess's Avatar

Credentials-NOChange ForWebAccess

19 Jan, 2015 05:56 AM

{IF $plan.code|strpos:'pc-' ==FALSE}
Show this only if the plan.code Contains "pc-"

         {/IF}

  1. 1 Posted by Credentials-NOC... on 19 Jan, 2015 07:37 AM

    Credentials-NOChange ForWebAccess's Avatar

    When I try to SAVE that template I get a general error (sorry, forgot the error #).

    I assume I have a syntax error.

  2. Support Staff 2 Posted by Marc Guyer on 19 Jan, 2015 03:17 PM

    Marc Guyer's Avatar

    I'm not sure. Can you give me more detail on the error message? What's the exact time the error was generated?

  3. Support Staff 3 Posted by Marc Guyer on 19 Jan, 2015 03:17 PM

    Marc Guyer's Avatar

    Also, which product are you testing this on?

  4. 4 Posted by Credentials-NOC... on 19 Jan, 2015 04:45 PM

    Credentials-NOChange ForWebAccess's Avatar

    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)

  5. Support Staff 5 Posted by Marc Guyer on 19 Jan, 2015 09:27 PM

    Marc Guyer's Avatar

    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 of strpos. 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. 6 Posted by Credentials-NOC... on 20 Jan, 2015 12:01 PM

    Credentials-NOChange ForWebAccess's Avatar

    And, just to be clear, I want the Case Insensitive version (Stripos).
    (Althought strpos would work in a pinch)

  7. 7 Posted by Credentials-NOC... on 22 Jan, 2015 05:28 PM

    Credentials-NOChange ForWebAccess's Avatar

    Any news on this"?

  8. Support Staff 8 Posted by Marc Guyer on 22 Apr, 2015 06:02 PM

    Marc Guyer's Avatar

    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!

  9. Marc Guyer closed this discussion on 22 Apr, 2015 06:02 PM.

  10. Marc Guyer closed this discussion on 02 Jun, 2015 02:46 PM.

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

Recent Discussions

28 Mar, 2024 10:45 PM
24 Jan, 2024 08:33 AM
11 Jan, 2024 07:13 AM
30 Nov, 2023 02:07 AM
22 Nov, 2023 08:41 AM