Announcement

Collapse
No announcement yet.

Mvt:Capture

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Mvt:Capture

    "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:

    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>
    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.

    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>
    soooo much cleaner...even a cave person can update.
    Bruce Golub
    Phosphor Media - "Your Success is our Business"

    Improve Your Customer Service | Get MORE Customers | Edit CSS/Javascript/HTML Easily | Make Your Site Faster | Get Indexed by Google | Free Modules | Follow Us on Facebook
    phosphormedia.com
Working...
X