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

    Here's my situation:

    I have a template "Hotel", which is assigned to every hotel root node/page.

    Is it possible to create a TV (let's call it "hotel1.background"), bind it to the "Hotel" template, and make it available only on one Hotel (let's call it Hotel1) node and not on any Hotel node?

    Thanks in advance
    alessandro
      • 28042 ☆ A M B ☆
      • 24,524 Posts
      You can use Form Customization for that. It might help to learn the correct MODx terminology; what you are calling a "node" would be a "resource" - if I understand correctly, anyway.
        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
        • 37625
        • 38 Posts
        Thanks Sottwell,

        I'll take a look at Form Customization.

        And yes, you are right about terminology smiley
          • 40045
          • 534 Posts
          I actually tried the same thing a while ago with no success (and knowing about form customization). I wanted a slider migx grid to only be shown for the home page, where it's used (nowhere else in the page, or if, I'd like to specify that later for specific resources in the same way).

          So I set the restriction field (inside form customization rule) to id (which results in modResource.id) and the restriction to 1 (for resource with ID 1 = home) and unticked the box (under Template Variables) for the respective migx tv (didn't matter what kind of tv, also tried with others), then saved.

          The outcome was, that the grid was now hidden on every resource, also on the home resource...so I'd never come so far to find out why this doesn't work...I also filed a bug here: http://tracker.modx.com/issues/9012 but never got any comment or feedback about it. So now as somebody else has the same problem I would be curious about if I was doing something completely wrong or if it's really a bug =)
            • 37625
            • 38 Posts
            Hi exside,

            actually I managed to achieve the expected result very quickly, after reading the docs about Form Customization.

            I have created a new Profile, then a new set with: Action -> Update resource, Template -> Hotel, Constraint field -> id, Constraint -> 10 (id of my resource).

            Then on TV tabs I have deselected the tv I don't want to see when editing the resource.

            That's all! Hope this helps.
            alessandro
              • 40045
              • 534 Posts
              hm,

              sounds like what I did too, but you DON'T want to see that TV on resource 10, right? I acutally tried to make a TV visible in ONLY ONE resource, so kind of the other way around =)...can you achieve that?