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’m still having this problem with my sidebar TV, so I’m posting here - does anyone know why I can’t select more than one document in my TV?

    Essentially I’d like to have content in documents rather than in chunks, and use @DOCUMENT bindings in the TV. But I get an SQL error if I select more than one document. Is this a bug? Or simply not possible (yet) in 0.9.5?

    Thanks
      • 10323
      • 35 Posts
      Hm, is no one else having this problem? Help please!
      Coding team, anyone maybe knows what’s going on?
      Thanks
        • 28042 ☆ A M B ☆
        • 24,524 Posts
        @bindings are stand-alone values. The @DOCUMENT binding only accesses the content field of a single document:
        @DOCUMENT 43

        for example.

        If you feel adventuresome, the code for this can be found in /manager/includes/tmplvars.commands.inc.php on line 29:

        			case "DOCUMENT":	// retrieve a document and process it's content
        				$rs = $modx->getDocument($param);
        				if (is_array($rs)) $output = $rs['content'];
        				else $output = "Unable to locate document $param";
        				break;
        
          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
          • 32319
          • 129 Posts
          Can you be more specific on how you are trying to select more than one document?
            "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
            • 10323
            • 35 Posts
            @Whitefen: See this thread - mentioned in the first post wink

            @Susan: Thanks for the info.
            The @DOCUMENT binding only accesses the content field of a single document.
            I couldn’t find this in the documentation. In the manager, in the TV input option values and default values fields it is stated that these fields support data source bindings using the @ commands. There is no mention that these commands cannot be used with multi-select input types. About modifying the code: I’ll give it a try. Suggestions are welcome - @bindings in multi-select input types would be cool...

            Cheers
              • 32319
              • 129 Posts
              I have found in my own tests that TV can only be used in in situation where there is only one return. For example, when I have had more than one check box set as a TV there is a result of no return rather than both check boxes. this would seem equal to a radio button but the problem there is that you can’t choose default again (or un-check all radio butons).

                "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