We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 40024
    • 72 Posts
    Hi, i have a question about multiTV. What i am trying to do is this: I have created some resources with multiTV in them. Is it possible to somehow get the values from the multiTV fields in those resources and display them on an resource while its being created(or even after it has been created)?

    The following detailed example might explain this further: Let's suppose we have a catalogue of items (the multiTV) with some fields: product name, price, description, image. A product can have multiple values, like 2 descriptions or two images (those are added in each resource with multiTV by pressing the "plus" image). Each product resource (suppose 100 products) have all of these multiTV fields populated already by me. Now, when my client creates a resource and wants to display some information about a product, i want the newly created resource(before or after creation doesn't matter) to display all of these multiTV fields and then he can choose to remove or add whatever he wants.
      • 13428 ☆ A M B ☆
      • 1,031 Posts
      Sorry, that is not possible out of the box. Even with @INHERIT a template variable contains not the value of its parent, it is just a 'pointer' to the real value. And in your case you want to combine multiple parents.

      It is somehow thinkable with a dbtable multiTV type. With that type you store all values in a custom db table and assign only some to the current resource. You have to write/enhance some multiTV processors for that.

        • 40024
        • 72 Posts
        I see. Thank you for your answer. I will try and find a workaround then wink
          • 13428 ☆ A M B ☆
          • 1,031 Posts
          You could write a plugin in onDocFormPrerender that retrieves all filled multiTV Template Variables of that type you want to fill automatic, that decodes them, joins the arrays and fills the multiTV of new documents (or document with an empty value).