Hi,
I would like to create own TV. It should work like parent resource input of template.
Any ideas?
Where is source code file of this default input?
You may not need a TV. This tag will be replaced by the parent ID:
or in Revolution
If that won’t do, you’ll have to explain exactly what you’re trying to accomplish.
When creating a new document, you need to specify parent id.
when you click Parent Resource input shows up the hint:
Please select a node in the tree to the left.
Next, you can select the document from tree and its value becomes input value.
I would like to create this type of TV.
-
☆ A M B ☆
- 24,524 Posts
Ah, you mean to be able to click on the Tree and get that document’s ID inserted into the TV automatically.
I don’t think there’s a way to get a TV to do that, unless you’re using the "custom TVs" modded version of Evo, although a custom ManagerManager extension might be able to pull it off; it’s all just javascript.
I added the same feature to the URL field of weblinks some years ago. If you look at the manager/actions/mutate_content.dynamic.php file, between lines 213 and 270 you’ll find the original parent setting javascript and the additional link setting functions that I added for weblinks. Basically I used the same functions, just changed the names and the names of the fields involved from "parent" or "p" to "link" or "l". I didn’t worry about getting the item’s name to display like the Select Parent field needs to do.
For using for a TV, you would need to implement these same two functions again for your specific TV field.
It’s a bit trickier than it seems; first you have to use a trigger (like the set parent does by clicking the little documents icon next to the set parent field) to override the normal click behavior of the Tree, then another bit of javascript to get the ID value of the item clicked and load it into the appropriate field. Then click again on the little icon to restore the Tree’s default click function.
-
☆ A M B ☆
- 24,524 Posts
That’s great! I was looking at making a custom widget for ManagerManager, which would do the same thing.
thanks a lot!
anyone try it in revolution if i need to rewrite it?
Where can i find parent resource input source code in revolution?
-
☆ A M B ☆
- 24,524 Posts
I seriously doubt Revo needs any such kludge as this! Everything in Revo’s back-end is adjustable, customizable, fold-able, spindle-able, and mutilate-able!
The whole point is to access the Tree so you can just click on an item to get its ID into the TV value field. Revo probably has a function somewhere just for doing that wherever you want to.
Quote from: sottwell at Jul 29, 2010, 11:40 AM
I seriously doubt Revo needs any such kludge as this! Everything in Revo’s back-end is adjustable, customizable, fold-able, spindle-able, and mutilate-able!
The whole point is to access the Tree so you can just click on an item to get its ID into the TV value field. Revo probably has a function somewhere just for doing that wherever you want to.
I haven’t tried it with TVs, but I think this would be drag-and-drop in Revo.