We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 8822
    • 203 Posts
    Does anyone know what is the best way to allow the content editor to add multiple instances of the same TV to a page. For example,I want to have a page that includes a list of recent projects undertaken, including image and descriptive text - the editor can obviously add as many projects as they like and i would like to store each 'project' as a TV with the editor able to say 'add another'. In a similar way, i would like to have info boxes down the right hand side of a page, with the user able to 'add' another info box as and when they like.

    This is Revo 2.2.4

    Would really appreciate anybodies ideas or suggestions smiley
      • 3109 ☆ A M B ☆
      • 894 Posts
      You can accomplish this easily with MIGX

      Good luck
        Benjamin Marte
        Interactive Media Developer
        Follow Me on Twitter | Visit my site | Learn MODX
        • 8822
        • 203 Posts
        Thanks Ben, thats perfect - just what i was looking for smiley Don't know how much you know about MIGX, but is there any issue with having two TVs defined as richText on the same page, when one is using MIGX and the other isn't? I have everything working correctly, picking up the correct image and Title, but the Description being displayed is from the content of a different richText TV, despite the fact that in Form Tabs i am referencing the correct TV

        {"field":"title","caption":"Title"},
            {"field":"projectdesc","caption":"Description","inputTV":"richtextTV"}
        ]


        The TPL chunk makes reference to 'projectdesc' too:

        <tr>
          <td rowspan="2">[[+image]]</td>
        		<td ><h2>[[+title]]</h2></td>
        </tr>
        <tr>
          <td>[[+projectdesc]]</td>
        </tr>


        Thanks smiley
          • 3109 ☆ A M B ☆
          • 894 Posts
          No the only way that should happen is if your using the same TV, so if your template is already using projectdesc somewhere else on the page you can't use it in MIGX.

          I'm not sure if I understood correctly but the main thing is MIGX should have unique TV names.

          Hope that helps.
            Benjamin Marte
            Interactive Media Developer
            Follow Me on Twitter | Visit my site | Learn MODX
            • 3749
            • 24,544 Posts
            To expand on Ben's comment, you can't have MODX tags of the same type and name pointing to different objects. MODX has no way of knowing which one you want.

            Name collisions can be devilish to identify and debug, so you should always use unique names for all objects with a particular tag style, and remember that TVs and Resource content fields share the same tag type. For example, you should never have a TV called 'content,' 'pagetitle,' or 'description.'


            ------------------------------------------------------------------------------------------
            PLEASE, PLEASE specify the version of MODX you are using.
            MODX info for everyone: http://bobsguides.com/modx.html
              Did I help you? Buy me a beer
              Get my Book: MODX:The Official Guide
              MODX info for everyone: http://bobsguides.com/modx.html
              My MODX Extras
              Bob's Guides is now hosted at A2 MODX Hosting
              • 10208 ☆ A M B ☆
              • 1,780 Posts
              Apparently you can't have a chunk and a snippet that have the same name either.

              I'm glad I read this, and since you were saying it's the MODX "tag style" that can't use the same name, I started thinking it might actually be more than tag style that confuses MODX.

              So on a hunch, I went and changed the name of the chunk that a snippet was using that completely gorked all pages that used this particular template, and it's fixed. I had used the same name as the snippet, thinking MODX would know which was which but it doesn't. Not only doesn't it know what to do with it, it doesn't know what to do with anything. It produces a completely blank page, nothing at all within opening and closing html tags except a few stray head tags (css and js mostly).
                Frogabog- MODX Websites in Portland Oregon
                "Do yourself a favor and get a copy of "MODX - The Official Guide" by Bob Ray. Read it.
                Having server issues? These guys have MODX Hosting perfected - SkyToaster
                • 8822
                • 203 Posts
                Hi Folks, Thanks so much for you comments - all really useful stuff smiley

                My problem is that the richtextTV which i am having issues with (though this has now been renamed to richtextrecentprojectsTV is only being referenced by one MIGX TV, so there shouldn't be any confusion. Let me show you my code below:

                recentprojectsTV (Form Tabs):
                [
                {"caption":"Recent Projects", "fields": 
                [
                {"field":"titlerecentprojects","caption":"Title"},
                    {"field":"descrecentprojects","caption":"Description","inputTV":"richtextrecentprojectsTV"}
                ]},
                {"caption":"Image", "fields":[
                    {"field":"imagerecentprojects","caption":"Image","inputTV":"imagerecentprojectsTV"}
                ]}
                ]
                


                recentprojectsTV (Grid Columns):
                [
                {"header": "Title", "width": "100", "sortable": "true", "dataIndex": "titlerecentprojects"},
                {"header": "Image", "width": "50", "sortable": "false", "dataIndex": "imagerecentprojects","renderer": "this.renderImage"}
                ]


                recentprojectsTpl:
                <tr>
                  <td rowspan="2">[[+imagerecentprojects]]</td>
                		<td ><h2>[[+titlerecentprojects]]</h2></td>
                </tr>
                <tr>
                  <td>[[+descrecentprojects]]</td>
                </tr>


                call from the template:
                <table>
                [[getImageList?
                  &tvname=`recentprojectsTV`
                		&tpl=`recentprojectsTpl`
                ]]
                </table>


                The problem is that the descrecentprojects is displaying the wrong text and not that identified in the page TV - Any ideas?

                THANKS !
                  • 8822
                  • 203 Posts
                  infact, further to the above, i actually don't know where the text it is displaying is coming from - to begin with it looked like it was from another TV on the page (called introboxTV, not MIGX) but when i update that text it does not reflect the text in the descrecentprojects field - it is almost like it has cached it somewhere - clearing the cache however makes not difference..............
                    • 4172
                    • 5,888 Posts
                    what do you get when you place this to your Template?

                    [[*recentprojectsTV]]
                      -------------------------------

                      you can buy me a beer, if you like MIGX

                      http://webcmsolutions.de/migx.html

                      Thanks!
                      • 8822
                      • 203 Posts
                      I get this:

                      [{"MIGX_id":"6","titlerecentprojects":"Garden Design in Fleet","descrecentprojects":"
                      
                      This is a description of garden design in Fleet
                      ","imagerecentprojects":"assets/images/plantofmonth-poppy.jpg"}] 


                      which is the correct description.........