"Mvt:capture is the best thing to happen to SMT code since SMT code was created -- FIGHT ME!"
Seriously. No more convoluted, escaped mvt:assigns, not more contorted code setups to deal with when variables are available, cleaner code, easier to update, blah, blah, blah....
Oh, you want to know how it works...okay:
Lets say you are in an array, and you want to create some content based on conditionals. Normally, you'd do something like:
Not bad...but editing, especially by non-SMT coders can be though...(think, apostrophe "d" as in don't...which you don't do, its "don\'t" of course.)
Now, let me introduce you to Ms. Capture.
soooo much cleaner...even a cave person can update.
Seriously. No more convoluted, escaped mvt:assigns, not more contorted code setups to deal with when variables are available, cleaner code, easier to update, blah, blah, blah....
Oh, you want to know how it works...okay:
Lets say you are in an array, and you want to create some content based on conditionals. Normally, you'd do something like:
Code:
<mvt:if expr="l.settings:this:variable EQ 'soWhat'"> <mvt:assign name="g.showThis" value="'<div class=\"mt-2 w-100\"><h2 class=\"float-left mr-3 mt-2 mb-1\">' $l.settings:someHeading$ '</h2><p class=\"mr-3 mt-2\">Some content here with a' $l.settings:withVariable$ '</p></div>'"/> </mvt:if>
Now, let me introduce you to Ms. Capture.
Code:
<mvt:capture variable="g.showThis"> <div class="mt-2 w-100"><h2 class="float-left mr-3 mt-2 mb-1">&mvt:someHead;</h2> <p class="mr-3 mt-2">Some content here with a &mvt:withVariable;</p></div> </mvt:capture>