I am working in Magento 2 static blocks. Inside the static block I want some content to be dynamic.

Is there any way to use knockout js in static block?

1 Answer 1


Yes. Knockout can be used inside Static Block. Insert the below code in a static block and save. On frontend page load you can see the text is updated using KO.

<div data-bind="text: 'Hello World'"></div>

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.