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

    Working on my first modx site and enjoying it but I've run into a problem.

    I have 4 resources all using one template. In the template I have a TV where some text can be filled out. This text is wrapped in an <a> tag which I want to link to a resource, in this case a food menu page. Each one of the 4 resources using this template should link to a different resource/food menu page.

    What is the best way to go about this?

    At the moment I have a TV for the text which describes the food menu name that the end-user clicks, and another TV inside the href part of the <a> tag which has input set to a resource and output to a url, but when i try to fill in the TV only the "home" resource is visible in the drop down selector. none of the of the other resources are visible in the drop down to select.

    What am I doing wrong/misunderstanding or should I take a different approach? I could make a separate template for each of the 4 resources that needs a different menu page linking to, but I'm sure there is a simpler, more scalable and more intelligent way to achieve this.

    Thanks in advance,

    David
      • 18373 ☆ A M B ☆
      • 3,141 Posts
      Mark Hamstra Reply #2, 15 years ago
      What version of MODX?

      What are your TVs input options set to, besides input type "Resource List"? Specifically I'd be interested in the limit, parents and depth.

      How's your resource tree set up in terms of structure?

      EDITED
      Actually, just testing this on my own install and I'm getting the same results. Setting "parents" to 0 (instead of leaving empty) solved it here though. Surprised that's not the default, and if you can confirm that - could you create an issue for that? http://bugs.modx.com/projects/revo/issues/new [ed. note: markh last edited this post 15 years ago.]
        Mark Hamstra • Developer spending his days working on Premium Extras and a MODX Site Dashboard with the ability to remotely upgrade MODX and extras to make the MODX world a little better.

        Tweet me @mark_hamstra, check my infrequent blog at markhamstra.com, my slightly more frequent ramblings at MODX.today or see code at Github.
        • 35103
        • 54 Posts
        Thanks for replying Mark,

        I'm using MODX Revolution 2.1.3-pl (traditional)

        My resource tree is is very simple (i think) just a home document, 3 more documents using the same template, and a final document - the one i am trying to link to. There is no "structure", I've just added them using the 'new document' button. I haven't set any parent resource parameter in any of these documents and as far as I can tell they are no different than the home document which does appear in my TV.

        The TV input type is resource tree and the output is URL. URL might be wrong but that is not the issue at the moment as I can't even select the resource I would like.

        I have attached some images from the manager.

        Thanks for your help
          • 18373 ☆ A M B ☆
          • 3,141 Posts
          Mark Hamstra Reply #4, 15 years ago
          Edit your TV and set the "parents" input option for the "resourcelist" TV to 0.

          What I tried to explain in my last post is that when there's no parent set that it doesn't retrieve anything but the homepage, but setting the parents to 0 will list the first level (all your resources in this case).
            Mark Hamstra • Developer spending his days working on Premium Extras and a MODX Site Dashboard with the ability to remotely upgrade MODX and extras to make the MODX world a little better.

            Tweet me @mark_hamstra, check my infrequent blog at markhamstra.com, my slightly more frequent ramblings at MODX.today or see code at Github.
            • 35103
            • 54 Posts
            Thanks Mark looks like that has done the trick! Really appreciate your help with that.