I have a title field with value: "Nobel Participatie Portefeuille".

On my template I want to trim the word "Nobel", You can do this with twig trim.

so this is my code:

{{ entry.title | trim('Nobel ') }}

But my output is "Nobel Cashflow Portefeui" (missing "lle")

Other words work normal.

1 Answer 1


So this would be a better solution:

{{ entry.title|replace('/^Nobel /', '') }}

Thanks for the support Craft!

  • 1
    I was going to comment and tell you that would be a better solution, but that wasn't the question you asked you Twitter. ;) Commented Jan 9, 2015 at 20:00

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.