Code Block Node Property
When the Code Block property of a node is enabled, CodeStencil will expand the string or execute the Code Nanite as a block of code. For example, assume:
(a) You have an expander MENU_ITEMS
with this string:
"index|about|Services|portfolio|Blog|Contact", and;
(b) Your node contains this code:
<nav class="main-menu">
<ul>
<li><a href="/[%MENU_ITEMS%].html">[%MENU_ITEMS%]</a></li>
</ul>
</nav>
(c) When you generate the code for this node with the "Use Code As A Block" UNCHECKED, this is what is generated:
<nav class="main-menu">
<ul>
<li><a href="/index.html">index</a></li>
<li><a href="/about.html">about</a></li>
<li><a href="/Services.html">Services</a></li>
<li><a href="/portfolio.html">portfolio</a></li>
<li><a href="/Blog.html">Blog</a></li>
<li><a href="/Contact.html">Contact</a></li>
</ul>
</nav>
(d) When you generate the code for this node with the "Use Code As A Block" CHECKED, this is what is generated:
<nav class="main-menu">
<ul>
<li><a href="/index.html">index</a></li>
</ul>
</nav>
<nav class="main-menu">
<ul>
<li><a href="/about.html">about</a></li>
</ul>
</nav>
<nav class="main-menu">
<ul>
<li><a href="/Services.html">Services</a></li>
</ul>
</nav>
<nav class="main-menu">
<ul>
<li><a href="/portfolio.html">portfolio</a></li>
</ul>
</nav>
<nav class="main-menu">
<ul>
<li><a href="/Blog.html">Blog</a></li>
</ul>
</nav>
<nav class="main-menu">
<ul>
<li><a href="/Contact.html">Contact</a></li>
</ul>
</nav>