We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 36786 ☆ A M B ☆
    • 209 Posts
    Is there a way to change what Tv's are displayed on a resource dependent on the value of another Tv? For instance, if i select "Has Video" boolean Tv then a Tv for input of embed code would be then show. Thanks!
      Ben Morrison
      Hacking templates to pieces since 2003
      • 28042 ☆ A M B ☆
      • 24,524 Posts
      It would be much easier to use an output modifier on the video TV. See the "isempty" and "notempty" modifiers http://rtfm.modx.com/display/revolution20/Input+and+Output+Filters+%28Output+Modifiers%29#InputandOutputFilters%28OutputModifiers%29-Stringoutputmodifiers

      If for some reason you don't want to use this method, you would need a snippet. The If snippet should be suitable.
        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
        • 40045
        • 534 Posts
        I understood it the other way around, but not sure how it's meant =).

        I think Ben ment if we can display different / "context" (not modx context =D) specific TVs in the manager when viewing a resource... an this would be dependent of a value of another TV.

        If it's that what you're asking for, I would second that question, would sometimes be very handy. [ed. note: exside last edited this post 13 years, 10 months ago.]
          • 36786 ☆ A M B ☆
          • 209 Posts
          Quote from: exside at Dec 13, 2012, 07:01 AM
          I understood it the other way around, but not sure how it's ment =).

          I think Ben ment if we can display different / "context" (not modx context =D) specific TVs in the manager when viewing a resource... an this would be dependent of a value of another TV.

          If it's that what you're asking for, I would second that question, would sometimes be very handy.

          Thats exactly what I meant smiley It would keep the page from getting cluttered and simplify it for an end user.
            Ben Morrison
            Hacking templates to pieces since 2003
            • 4172
            • 5,888 Posts
            This should be possible with a special coded custom-TV-type.

            But the easiest way would be to have different templates.
            In your case a 'hasvideo'-template with the additional input-TV(s) for the video.
              -------------------------------

              you can buy me a beer, if you like MIGX

              http://webcmsolutions.de/migx.html

              Thanks!
              • 40045
              • 534 Posts
              Yeah, that's how I do it at the time too, but it would be so nice if TVs could be linked with each other (create dependencies), like the example mentioned by Ben:

              for example have a select box "Video" and when it's checked, there would slide (just below) open another TV (this time for example a textarea) for the embed code...without reloading the page actually =)...there would be a lot of scenarios where that would be so helpful.

              This would probably involve hardcore extJS work (nothing I could do) and some plugin or as you said some custom TV type...but I think if you have to reload the whole page to actually see the additional field, it doesn't make sense...

              And personally I try to minimize the amount of templates, maintenance seems easier with only a few or one of them...at least for me.
                • 36786 ☆ A M B ☆
                • 209 Posts
                I agree excide, it would be very handy but it's out of my league to create myself... I was just curious if someone had already done it before and could share the experience and methodology.
                  Ben Morrison
                  Hacking templates to pieces since 2003
                  • 40045
                  • 534 Posts
                  ...so we're sitting in the same boat, its also out of my skill-level^^, but I thought about it several times (and just forgot about it bc it seems so far from doable for me), so any experiences/thoughts/samples from anybody are welcome and valued by 2 persons =)!