We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 10323
    • 35 Posts
    I have sidebar blocks selectable in a TV like described in this thread or in this Wiki article. Now I want the content in documents rather than in chunks so that content editors can easily change it in the manager - without access to the resources section.

    This must be possible in MODx - Can anyone please point me in the right direction?! Thanks.
    • Try a TV with @DOCUMENT xx bindings, where xx is the document ID that has the HTML code (and MODx tags) that you want in its content area.
        Studying MODX in the desert - http://sottwell.com
        Tips and Tricks from the MODX Forums and Slack Channels - http://modxcookbook.com
        Join the Slack Community - http://modx.org
        • 10323
        • 35 Posts
        Thanks Susan, but I get this to work only if I select one checkbox at a time. As soon as I select two or more, I get a parse error. My input option values look like this:
        Kontakt==@DOCUMENT 20||Reservation==@DOCUMENT 21

        The error message contains this:
        WHERE (sc.id IN (20||@DOCUMENT 21)

        I’m sure you know what I’m doing wrong...
        Cheers

        P.S. I saw your ideas here, but that seems out of date?...
          • 10323
          • 35 Posts
          Is it true that only one document can be included per TV - as stated here?

          If it is, then that would explain why @DOCUMENT binding is not working with my TV of input type checkbox... >:(

          Does anyone have a suggestion? is the outputPage snippet the only way to go?
            • 11975
            • 2,542 Posts
            Change your TV type to listBox multi for instance

            ;-)
              Made with MODx : [url=http://www.copadel.com]copadel, fruits et l
              • 10323
              • 35 Posts
              Change your TV type to listBox multi for instance

              Hmm, listBox multi gives me the same error like the checkbox type TV when i select more than one document at a time (Please see my first post in this thread). My question is: Is it possible to include more than one document using @DOCUMENT binding in a TV like this:
              Block A==@DOCUMENT xx||Block B==@DOCUMENT xy

              (I can’t find documentation that says whether it’s possible.)
                • 11975
                • 2,542 Posts
                Hi,

                can you tell us which widget you choose in your tv Settings

                Could you try with the following settings
                widget delimited list
                value ||

                :-)
                  Made with MODx : [url=http://www.copadel.com]copadel, fruits et l
                  • 10323
                  • 35 Posts
                  Hi,

                  I had not selected any widget before. When I try with the Delimited List widget and the delimiter || as you suggested, the TV basically behaves the same: It displays the document content if only one (out of two) documents is selected in the TV, but it returns an error when both documents are selected:

                  SQL: SELECT DISTINCT sc.* FROM `modx`.site_content sc LEFT JOIN `modx`.document_groups dg on dg.document = sc.id WHERE (sc.id IN (20||@DOCUMENT 21) AND sc.published=1 AND sc.deleted=0 ) AND (sc.privateweb=0) GROUP BY sc.id LIMIT 1


                  I thought it should work the same as with chunks (no widget):
                  Block A=={{Chunk_A}}||Block B=={{Chunk_B}}

                  Only replacing the chunks by @DOCUMENT bindings (as Susan suggested):
                  Block A==@DOCUMENT xx||Block B==@DOCUMENT xy

                  Or even mixing the two:
                  Block A=={{Chunk_A}}||Block B==@DOCUMENT xy


                  Wouldn’t this be nice? Thanks for your help!
                    • 32319
                    • 129 Posts
                    I have found the same to be true, if you select more than one option; no matter your type, you get nothing unless you select one or the other. My assumption would be that a TV can only return on answer regardless of its type (check box, multi select or radio). Of course, it would be a much more powerful feature if you could return more than one result from the TV.
                      "Regret for the things we did can be tempered by time; it is regret for the things we did not do that is inconsolable."
                      -- Sydney Harris