Jump to Content
BSD Twig DocumentationGuides
GuidesDiscussions
GuidesLog InBSD Twig Documentation
Guides
Log In
GuidesDiscussions

Twig Tags

  • Twig Documentation
  • Constituent Info
  • Address and Phone
  • Custom Constituent Data
  • Contributions
  • Membership
  • Events
  • Twig Link Functions
  • Unique Identifiers
  • Contribution History Data

Basic Usage

  • Fallbacks
  • Working with numbers
  • Working with strings
  • Working with arrays and objects
  • Working with dates
  • Language Limitations

Code Samples

  • Constituent Groups
  • Contribution Asks
  • Donor Conditional Content
  • Useful Twig Functions and Filters
  • Other Examples
  • BSD Helper Functions
  • Using Contribution History

Resources

  • Twig Language Documentation
  • Twig for Template Designers
  • Twig Filters
  • Twig Functions
Powered by 

Working with strings

Suggest Edits

String containment

If you'd like to check if your string contains a particular substring, you can use the in containment operator:

{% if "x" in cons.name %}
You have an x in your name. How cool is that?
{% endif %}

Updated less than a minute ago


  • Table of Contents
    • String containment