We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 28870
    • 10 Posts
    I am new to this and trying to help someone finish up his modx site. I’ve been searching all morning and can’t seem to find what I’m looking for, so bear with me if it’s a dumb question.

    I have created a TV called contributing_authors that looks like this:
    @SELECT pagetitle, id FROM site_content WHERE parent = 90

    It is a multi-select list box.

    The parent folder contains biographies of the contributing authors.

    My problem is that when I output [+contributing_authors+] in a chunk, only the id part is displayed and I need to make their names (the ’pagetitle’ part) display. I need to be able to access both the id and the pagetitle in order to make a clickable link on a summary page to each contributor’s biography, if that makes any sense.

    Is there a way to neatly get the different pieces stored in a TV? I wrote a snippet to do it on the individual article pages, but it won’t work in the chunk which displays a summary of each article on the main page. THANKS!


      • 28870
      • 10 Posts
      Maybe it would help if someone could tell me the difference between [+TVname+] and [*TVname*] and if there are any other ways of getting the data stored in the TV.
        • 7231
        • 4,205 Posts
        [+tvname+] in Ditto template chunck (also other snippets)

        [*tvname*] in site template. This is the main way the other is the snippet way.
          [font=Verdana]Shane Sponagle | [wiki] Snippet Call Anatomy | MODx Developer Blog | [nettuts] Working With a Content Management Framework: MODx

          Something is happening here, but you don't know what it is.
          Do you, Mr. Jones? - [bob dylan]
          • 27376
          • 576 Posts
          [tt][*TVName*][/tt] is the proper way to reference TVs. the [tt][+whatever+][/tt] method is for referencing a MODx placeholder. Also, TVs will display differently on the frontend than they would in the manager:

          • "Input Type" determines how the TV will display in the manager.
          • "Widget" determines how it will display on the frontend.
          When using @SELECT binding with two return columns (pagetitle, id), The second column will be what was saved to the database. The first column will be what is shown to the user when editing a document using this TV in the manager.

          You would need to create custom code (in the form of a snippet I suppose) to get the pagetitle to display instead of the id on the frontend.
            • 28870
            • 10 Posts
            Thanks. I did create the snippet and got it working on the content pages, but it’s not working on my index page for some reason. Oh well...I’ll get it. I was just hoping that it was all saved to the database and could be accessed by something nifty like [*TVname[pagetitle]*] . Thanks for the help.
              • 27376
              • 576 Posts
              Quote from: sunnysarah at Nov 09, 2007, 05:43 PM
              I was just hoping that it was all saved to the database and could be accessed by something nifty like [*TVname[pagetitle]*]
              No, but that IS a good idea.... tongue It’s features like these that you’ll just have to wait for 0.9.7 wink
                • 28870
                • 10 Posts
                Quote from: sirlancelot at Nov 09, 2007, 05:59 PM

                Quote from: sunnysarah at Nov 09, 2007, 05:43 PM
                I was just hoping that it was all saved to the database and could be accessed by something nifty like [*TVname[pagetitle]*]
                No, but that IS a good idea.... tongue It’s features like these that you’ll just have to wait for 0.9.7 wink

                It won’t be out by Monday morning, will it? wink