We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 50070
    • 12 Posts
    The Formalicious (from Sterc) beta uses nested placeholders:

    [[!+fi.error.field_[[+id]]]]


    ... in templates ...

    <div class="row">
    	<div class="form-group col-xs-12">
    		<label for="field_[[+id]]">[[+title]]:</label>
    		<select name="field_[[+id]]" id="field_[[+id]]" class="form-control">[[+values]]</select>
    		[[!+fi.error.field_[[+id]]]]
    	</div>
    </div>


    Is it possible to use those with an output modifier to conditionally display some text as you would a normal FormIt error?

    [[!+fi.error.name:notempty=`blah blah blah`]]
      • 3749
      • 24,544 Posts
      In theory, yes, but sometimes when things get too deeply nested (e.g., if the tag for the snippet that sets the error placeholder is in a chunk, it might not work). Conditional output modifiers inside placeholder tags, inside Tpl chunks sometimes don't work.

      I assume that you want something like this:

      [[!+fi.error.field_[[+id]]:notempty=`<p>`[[!+fi.error.field_[[+id]] ]] ]]</p>


      It's worth a try, though I usually use a custom snippet for something like this because it's faster and more reliable.
        Did I help you? Buy me a beer
        Get my Book: MODX:The Official Guide
        MODX info for everyone: http://bobsguides.com/modx.html
        My MODX Extras
        Bob's Guides is now hosted at A2 MODX Hosting
        • 50070
        • 12 Posts
        Quote from: BobRay at Mar 01, 2016, 11:34 PM
        [[!+fi.error.field_[[+id]]:notempty=`<p>`[[!+fi.error.field_[[+id]] ]] ]]</p>

        I wanted to avoid adding a new dependency if possible. But what you described seems to be the case here, so a quick snippet will be the way to go.

        Thanks!