Magento Stack Exchange is a question and answer site for users of the Magento e-Commerce platform. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

In Magento 1, if you wanted to transform an arbitrary block of text, the same as the body of a CMS page or block might be changed, you could use the following model class


This object was also available via the CMS data helper's getBlockTemplateProcessor method.


In Magento 2, there is no CMS data helper object. There is also no CMS template object.

In Magento 2, if I want to transform an arbitrary string as through it were a CMS page or CMS block, how would I do that?

share|improve this question
up vote 4 down vote accepted

if I understand you correctly, you can do this with the


if you want to "filter" a string with cms "objects" it should be working like this:

return $this->filterProvider->getBlockFilter()

hope I understood your question right :X

share|improve this answer
Yup, that's the class I was looking for. Thank you for saving me the code glopping! :) – Alan Storm Feb 10 at 21:26
Wow, done without a single static method. – Buttle Butkus Feb 11 at 4:05

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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