-
☆ 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
-
☆ 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.
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.]
-
☆ A M B ☆
- 209 Posts
Quote from: exside at Dec 13, 2012, 07:01 AMI 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

It would keep the page from getting cluttered and simplify it for an end user.
Ben Morrison
Hacking templates to pieces since 2003
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.
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.
-
☆ 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
...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 =)!