We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 51285
    • 11 Posts
    Hi is it possible to add html to a migx placeholder? I want to ad a
    but only if the user fills in a certain filed in the mix tv.
    I have tried a few things to get it to work but I'm new to this and its just not happening for me.

    thanks
    James

    This question has been answered by paulp. See the first response.

      • 4172
      • 5,888 Posts
      have an example?
        -------------------------------

        you can buy me a beer, if you like MIGX

        http://webcmsolutions.de/migx.html

        Thanks!
        • 51285
        • 11 Posts
        I want to use it for a branch office address, the company has multiple branches. Some have more lines in their address than others. Basically i want the [[+address2]] placeholder to have a brake so it can be on the next line after [[+address1]] but only if the user fills in the field in the migx TV.

            <div class="w-col w-col-3 address-column">
                <div class="address-wrapper">
                    <ul class="w-list-unstyled">
                        <li class="address-list-item">
                            <div class="branch-name-text">[[+branchName]]</div>
                        </li>
                        <li class="w-clearfix address-list-item"><img class="address-icon" width="16" src="/assets/uploaden/bild/icons/location.png">
                            <div class="address-text">[[+address1]]
                                    [[+address2]]
                                <br>[[+zip]] [[+city]]</div>
                        </li>
                        <li class="w-clearfix address-list-item"><img class="address-icon" width="16" src="/assets/uploaden/bild/icons/tel.png">
                            <div class="address-text"><a class="phone-link" href="tel:[[+tel]]">[[+tel]]</a>
                            </div>
                        </li>
                        <li class="w-clearfix address-list-item"><img class="address-icon" width="16" src="/assets/uploaden/bild/icons/fax.png">
                            <div class="address-text">[[+fax]]</div>
                        </li>
                        <li class="w-clearfix address-list-item"><img class="address-icon" width="16" src="/assets/uploaden/bild/icons/email.png">
                            <div class="address-text">Kontakt:
                                <br><a class="mailto-link" href="mailto:[[+email]]">[[+contactName]]<br></a>
                            </div>
                        </li>
                    </ul>
                </div>
            </div>
        

        • discuss.answer
          • 22840
          • 1,572 Posts
          Try the following

          [[+address2:notempty=`<br />[[+address2]]`]] 
            • 51285
            • 11 Posts
            Perfect thanks Paul
              • 22840
              • 1,572 Posts
              Glad it's working, theres several Output modifiers that can be used but be careful with how you use them.

              https://rtfm.modx.com/revolution/2.x/making-sites-with-modx/customizing-content/input-and-output-filters-(output-modifiers)