What You’ll Learn in This Module

When you write a Cast narration that says β€œJason’s progress this quarter” or β€œAcme LLC’s health score,” you need the possessive apostrophe to be grammatically correct. But the name is dynamic β€” it comes from CRM data and might end in β€œs” or might not. The cast_apostrophe filter handles this automatically, applying the correct English possessive rule every time.

πŸ“– https://school.cast.app/liquid/custom-cast-filters.html#cast_apostrophe


What Is cast_apostrophe?

The cast_apostrophe filter adds a possessive apostrophe to whatever text value you give it. It follows the standard English grammar rule:

  • If the name ends in β€œs” β†’ add just an apostrophe: James'
  • If the name does not end in β€œs” β†’ add apostrophe + s: Jason's

Analogy: Think of writing a mail merge letter that says β€œDear [Name]’s family.” If the name is β€œSmith,” you want β€œSmith’s family.” If the name is β€œJames,” you want β€œJames’ family.” You can’t hard-code the apostrophe because you don’t know which name will be inserted. cast_apostrophe makes the decision for you.

Why it matters in Cast

Possessive names appear constantly in narrations: β€œ[Company]’s renewal,” β€œ[Contact]’s health score,” β€œ[Contact]’s team.” Getting the grammar wrong (β€œJames’s” is debatable; β€œJasons’” is clearly wrong) looks unprofessional in both text and spoken audio. cast_apostrophe guarantees correctness for any name.


Basic Usage


{{ contact_first_name | cast_apostrophe }}

That’s it. The filter looks at the last character and applies the right rule.


Examples

Input Output Rule Applied
"Jason" Jason's Does not end in s β†’ add β€˜s
"Liz" Liz's Does not end in s β†’ add β€˜s
"James" James' Ends in s β†’ add β€˜ only
"Charles" Charles' Ends in s β†’ add β€˜ only
"Julius" Julius' Ends in s β†’ add β€˜ only
"Acme LLC" Acme LLC's Does not end in s β†’ add β€˜s
"AT&T Services" AT&T Services' Ends in s β†’ add β€˜ only

Real Cast Examples

First name possessive:


{{ contact_first_name | cast_apostrophe }} progress this quarter has been outstanding.

For "Jason" β†’ Jason's progress this quarter has been outstanding. For "James" β†’ James' progress this quarter has been outstanding.

Company name possessive (chained with cast_titlecase):


Welcome to {{ contact_account_name | cast_titlecase | cast_apostrophe }}
Executive Business Review.

For "ACME LLC" β†’ Welcome to Acme LLC's Executive Business Review. For "AT&T SERVICES LLC" β†’ Welcome to AT&T Services LLC's Executive Business Review.

Account tenure:


{{ contact_first_name | cast_apostrophe }} account has been active
for {{ CustomerSince }}.

For "Priya" with a tenure of 2 years β†’ Priya's account has been active for 2 years and 3 months.


Chaining with Other Filters

The most common chain is cast_titlecase β†’ cast_apostrophe, applied to company names:


{{ contact_account_name | default: "your company" | cast_titlecase | cast_apostrophe }}

The order matters: first normalize the casing, then add the possessive. If you reversed the order, cast_titlecase might alter the possessive suffix.

You can also chain with default for safety:


{{ contact_first_name | default: "Your" | cast_apostrophe }}

For "Jason" β†’ Jason's For nil/empty β†’ Your's β€” wait, that’s grammatically wrong! β€œYour” is already possessive. This is a case where you need to think about your fallback carefully.

πŸ’‘ Better fallback pattern for possessives:


{%- assign name = contact_first_name | default: "" -%}
{% if name == "" %}
  Your progress this quarter has been outstanding.
{% else %}
  {{ name | cast_apostrophe }} progress this quarter has been outstanding.
{% endif %}

This avoids the awkward β€œYour’s” by using a separate sentence structure for the fallback.


Common Mistakes

❌ Hard-coding the apostrophe instead of using the filter:


{{ contact_first_name }}'s account is thriving.

This always produces 's, even for names ending in β€œs” β€” giving you James's instead of James'.

βœ… Use cast_apostrophe:


{{ contact_first_name | cast_apostrophe }} account is thriving.


❌ Adding extra text after the filter:


{{ contact_first_name | cast_apostrophe }}'s account

This would produce Jason's's account β€” a double possessive.

βœ… The filter already adds the possessive β€” just follow with a space:


{{ contact_first_name | cast_apostrophe }} account


❌ Using a possessive pronoun as the default:


{{ contact_first_name | default: "Your" | cast_apostrophe }}
β†’ "Your's"  (grammatically incorrect)

βœ… Handle the fallback case separately:


{%- assign name = contact_first_name | default: "" | strip -%}
{% if name != "" %}
  {{ name | cast_apostrophe }} account health is strong.
{% else %}
  Your account health is strong.
{% endif %}


Try It Yourself

Exercise: Write a Cast narration snippet that says β€œ[Company]’s growth this year has been [above/below] the industry average.” Use cast_titlecase and cast_apostrophe for the company name, and handle the case where the company name might be missing.

Assume you have variables: contact_account_name (might be nil) and growth_vs_avg (a snippet that returns "above" or "below" as a string).

Click to reveal the answer ```liquid {%- assign company = contact_account_name | default: "" | strip -%} {%- assign comparison = growth_vs_avg | default: "in line with" | strip -%} {% if company != "" %} {{ company | cast_titlecase | cast_apostrophe }} growth this year has been {{ comparison }} the industry average. {% else %} Your company's growth this year has been {{ comparison }} the industry average. {% endif %} ``` For `"ACME LLC"` with `growth_vs_avg` = `"above"`: `Acme LLC's growth this year has been above the industry average.` For nil company name: `Your company's growth this year has been in line with the industry average.` Key details: - `cast_titlecase` before `cast_apostrophe` β€” always normalize casing first - Separate handling for missing company name avoids "Your Company's" awkwardness - Snippet output is stripped before use

What’s Next

In Module 10, you’ll learn about cast_pronounce β€” the filter that controls how Cast’s audio narrator speaks acronyms, product names, version numbers, and tricky words.


πŸ“– Official documentation:

  • Custom Cast Filters: https://school.cast.app/liquid/custom-cast-filters.html#cast_apostrophe

This site uses Just the Docs, a documentation theme for Jekyll.