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

    I have a site where I for some resources (e.g. seminars, news, etc) in the manager want to be able to dynamically add additional info under a "Read more" section. For instance external links, internal links, uploading and linking of pdfs.

    Ideally (for it to be intuitive for the site editors) I'd want to click an "Add button", chose type of data (external link, internal link or file upload), enter some info and a new TV is created.

    I have no real clue on how to accomplish this. I've looked at MIGX, but not quite figured out how/if that could be a solution.

    Any ideas?
      • 4172
      • 5,888 Posts
      Yes, MIGX can do that.
      You can configure a dropdown-field for the type
      Add a file-TV-type for uploading and choosing a file
      Add more fields for titles, descriptions and what you need as you like.

      On the frontend you can use the included getImageList-snippet, which is not only for listing images, but also for all kind of Json-records, produced by MIGX

      Tip:
      It would also be possible to have own file-directories for each resource with a dynamic mediasource, if you don't want to have all files in the same directory.
        -------------------------------

        you can buy me a beer, if you like MIGX

        http://webcmsolutions.de/migx.html

        Thanks!
        • 20471
        • 40 Posts
        Ok, that's the if-part, now it's just the how-part smiley

        You mean it's be possible to (in the manager) only render the file-TV-type if I've selected "File" in the first dropdown? And similarly, only render an URL-TV-type if I've selected "URL"? What would the Form Tabs-code for such a solution look like?

        Also, is it possible to use different tpl-chunks with the getImageList-snippet, depending on the value of the first drop-down?

        Thanks!
          • 4172
          • 5,888 Posts
          Its possible to have muliple forms. Between them its possible to swich by a dropdown.

          To get this dropdown-field you would create one configuration in the MIGX-configurator for each form.
          For this configurations you need only fill out the formtabs.

          Then for the MIGX-TV itself you would choose the configurations under Formtabs -> multiple formtabs

          This will create a dropdown on your Form with the names of your configurations.
          If you select one of them, the Form swiches to the selected configuration. Its a good Idea to have the same field-names for all two or three Forms.
          You can use the hidden inputTVtype for input-fields which you don't need on all Forms.
          This way you don't loose information, when swithich from one form to another one.

          to switch between different chunks while listing on frontend you can use this property:

          &tpl=`@FIELD:MIGX_formname`


          this will switch the to tpl-chunks with the same name of the selected configuration, which is stored in the field: MIGX_formname
            -------------------------------

            you can buy me a beer, if you like MIGX

            http://webcmsolutions.de/migx.html

            Thanks!
            • 20471
            • 40 Posts
            Ok, think I'm starting to get the hang of this now.

            I now have Form Tabs-code like this:
            [
            {"formname":"Dokument", "formtabs":
             [{"caption":"PDF", "fields":[
              {"field":"url","caption":"Fil","inputTV":"fileTV"},
              {"field":"title","caption":"Titel"}
             ]}]
            },
            {"formname":"Länk", "formtabs":
             [{"caption":"Länk", "fields":[
              {"field":"url","caption":"URL","inputTV":"urlTV"},
              {"field":"title","caption":"Titel"}
             ]}]
            }
            ]


            With grid columns:
            [
            {"header":"Titel", "width":"150", "sortable":"true", "dataIndex":"title"},
            {"header": "", "width":"150", "sortable":"false", "dataIndex":"url"}
            ]


            And this works as expected, but looks a bit weird (se attached image):
            - The actual tabs are above the form-dropdown. Should it be like this or am I doing something wrong?
            - The label for the form-dropdown is "Formname". Is there any way to change this, or remove the label alltogether?

            Really appreciate your help Bruno!