Important Notice: Our web hosting provider recently started charging us for additional visits, which was unexpected. In response, we're seeking donations. Depending on the situation, we may explore different monetization options for our Community and Expert Contributors. It's crucial to provide more returns for their expertise and offer more Expert Validated Answers or AI Validated Answers. Learn more about our hosting issue here.

I get an compile error when I try to use $story or $element in a Mason template <%once> block. What gives?

block Error gives mason Template Try
0
Posted

I get an compile error when I try to use $story or $element in a Mason template <%once> block. What gives?

0

To check the syntax of a Mason template as you develop it, Bricolage creates a Mason interpreter and compiles the template. Because <%once> blocks are designed to execute only once, Mason actually executes them during the compile. Of course, there is no $story or $element object when you’re editing a template, only when you’re publishing or previewing a story.

Related Questions

What is your question?

*Sadly, we had to bring back ads too. Hopefully more targeted.

Experts123