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

    I’ve just been chatting with a potential client about a site. They currently use a different CMS, and he showed me one feature which he will need in his new system (to be built with MODx!)

    Basically, there was a page with the usual content, a few custom fields (TVs if you prefer to call them that!) and also a series of checkbox areas. For instance, you could choose which accommodation was available by checking one box. When you saved this, the content for that accommodation (which was a page in itself that you could edit in the backend) would appear within the page that you’d selected it on.

    Does that make sense? Basically, I would kind of need to be able to populate a dropdown, or several checkbox fields with a list of resources (I suppose it’d be best if they were all in the same folder). Then when somebody selects one of them, the content of the selected resource appears in the main resource.

    Hope that makes sense! Was just wondering how it could be achieved with MODx.

    Thanks
      • 4172
      • 5,888 Posts
      in Revolution you can use the resource-list TV for the backend.

      On the frontend you can use getResources and the property
      &resources=`[[*yourResourceListTv]]`
        -------------------------------

        you can buy me a beer, if you like MIGX

        http://webcmsolutions.de/migx.html

        Thanks!
        • 33968
        • 863 Posts
        For populating your checkbox list, have a look at ’advanced usage’ here:
        http://rtfm.modx.com/display/revolution20/Template+Variable+Input+Types#TemplateVariableInputTypes-CheckBox

        You can use the @SELECT or @EVAL bindings to run a database query or php snippet respectively which will allow you to list resources dynamically.
          • 33968
          • 863 Posts
          @Bruno - is ’Resource List’ a new feature? Never noticed that before!!!
            • 21122
            • 153 Posts
            Oh cool, thats really handy!

            I think I’m going to have to run a quick few tests to make sure this all works (I’m sure it does!)

            Thanks both