We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 31283
    • 22 Posts
    Hello,

    I’m looking to allow the client the ability to add disclaimers to their content pages. I’ve set up the jquery and everything’s working fine, but I’m stumped on how to best build this so that they can add any number of disclaimers.

    Here are my initial thoughts:

    • 1. Set up some template variables?
    • 2. Write snippet to parse tv’s and create proper divs and links for each one.

    The latter shouldn’t be hard, but I’m not sure how to set it up so that they can add as many disclaimers as they want. Or for that matter, how to make it so that they can drop them in anywhere into the content with minimal fuss.

    For example, it would be great if they could edit:

    Lorem ipsum dolor sit amet


    to read:

    Lorem ipsum dolor <a href="#disclaimer1">[1]</a> sit amet


    ...without the client having to add the link tags themselves (they’ll inevitably break the site).

    Any ideas?

    Thanks.
      • 15022
      • 31 Posts
      Seems to me this depends a lot on the structure that these disclaimers will need and the ability of the people creating/editing them, in this case, your clients.

      If you think the disclaimers would take the form of
      <ul>
      <li><a href="link 1">link text 1</a></li>
      <li><a href="link 2">link text 2</a>.. etc
      </ul>
      


      Then you could set up one TV to accept comma delimited values in the form of "link text 1, link 1, link text 2, link 2".

      I think it’s just easier to set up one TV that can accept a number of values when the number of items is unpredictable or needs to be flexible. Then you could write a snippet to display the output the way you want (such as an unordered, linked list). But the key to this is a predictable format and you’d have to check for input mistakes.

      If you can’t predict a format or it has to be freeform then you could set up a TV that uses tinyMCE to help your client build those links properly.

      Do you think some or all of these disclaimers could ever be reused from page to page? Are the disclaimers linked to other pages on the site or offsite? If that is the case you could set up a parent page for all the disclaimers, let your client populate the child pages. Create a template variable for pages needing disclaimers which allows the client to pick which disclaimers apply to the current resource.

      Hope this is helpful.
        illegitimati non carborundum
        • 31283
        • 22 Posts
        This was very helpful; thank you for the information! grin
          • 18373 ☆ A M B ☆
          • 3,141 Posts
          If you’re savvy enough, try Custom TV’s. It’s for Evo. I’ve yet to try it myself, but the demos look *very* promising.

          http://modxcms.com/forums/index.php/topic,49153.html
            Mark Hamstra • Developer spending his days working on Premium Extras and a MODX Site Dashboard with the ability to remotely upgrade MODX and extras to make the MODX world a little better.

            Tweet me @mark_hamstra, check my infrequent blog at markhamstra.com, my slightly more frequent ramblings at MODX.today or see code at Github.