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

    I try to make a wine suggestion system for a site I make (ModX Evo)

    So, I have some containers with the wines (each resource a different wine with many TV's)
    In another container I have the recipies

    What I want to do is to be able to choose which wine or wines I suggest for each recipy.

    What I have done till now is to create a TV (the name is tv_wines) and associated it with the recipy template where I can choose the wines.
    It is a Checkbox type TV with:

    @SELECT pagetitle, id, tv_wine_bottle FROM modx_site_content WHERE parent in (59,60)

    pagetitle and id are the obvious
    tv_wine_bottle is a TV which holds the wine image

    When I edit a recipy I can see the checkboxes with the wines and I can select them.

    My problem is how can I display all of them to the frontend.

    When I try to display it (for example I use [*tv_wines*] in the recipy template) I just get the id's of the wines I selected. How can I display all of them? The pagetitle, the id and the tv_wine_bottle?
    My goal to to create a floating div with the image (tv_wine_bottle) and a link to the resource.

    Thanks in Advance
      • 4172
      • 5,888 Posts
      you just need
      @SELECT pagetitle, id FROM modx_site_content WHERE parent in (59,60)


      without the TV.

      Then make the output of your TV a delimited list and make sure your have ',' as delimiter.

      Then you can call Ditto with
      &documents=`[*tv_wines*]`


      place all your infos like the image-TV, pagetitle, and the link to the resource into your Ditto-tpl.
        -------------------------------

        you can buy me a beer, if you like MIGX

        http://webcmsolutions.de/migx.html

        Thanks!
        • 7434
        • 24 Posts
        Thanks a lot. It worked right away smiley