We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 10386
    • 42 Posts
    I would like to create a TV drop down selection, fed with entries following a template, as in:

    The template "project" will have a TV which is drop down menu, displaying all the entries -documents- which are assigned the template "brands", is it possible?
      • 28042 ☆ A M B ☆
      • 24,524 Posts
      Yes. Use a @SELECT binding in the Input Option Values field, to get the resources that have the correct template.
      @SELECT pagetitle,id FROM modx_site_content WHERE template = 1

      This will display the drop-down with the page titles of the resources, while its output will be the resource ID that was selected. You can manipulate that using output modifiers, fastField, or any other snippet or utility to deal with resource IDs.
        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
        • 10386
        • 42 Posts
        Thank you, i dont yet seem to get it working..
        I dont seem to get this working, if i want to list all the pagetitle from the ressources with template 10
        @SELECT pagetitleb WHERE template = 10
        


        Where am I wrong?

        Quote from: sottwell at Jan 21, 2014, 11:01 AM
        Yes. Use a @SELECT binding in the Input Option Values field, to get the resources that have the correct template.
        @SELECT pagetitle,id FROM modx_site_content WHERE template = 1

        This will display the drop-down with the page titles of the resources, while its output will be the resource ID that was selected. You can manipulate that using output modifiers, fastField, or any other snippet or utility to deal with resource IDs.
          • 28042 ☆ A M B ☆
          • 24,524 Posts
          The fieldname is pagetitle, not pagetitleb, and you have to tell the SELECT query what table to select from.
            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