We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 41574
    • 14 Posts
    Ok I figured out the issue of only one row. I used the same values each time I added an anotation. I only added one row each time. I figured it was just a matter of not displaying the values but the values were still there in the db. So each time there was only one row showing when I saved it. I thought it would add to what was already there. Instead it just replaced what was there with my new entry which was the same as my old entry and so I thought it wasn't being recorded because I was expecting to see two rows. So the only problem I really have is the values not showing up in the editor as depicted in anotations.png.
      • 41574
      • 14 Posts
      Ok now I am thinking maybe I wasn't hitting save. I am now seeing html in the db. Is that how it is supposed to work?

      [{"MIGX_id":"1","Image":"assets/img/bg1.jpg","Resolution":"1920","Anotations":"<table>\n    <tr>\n        <th>Intro</th>\n        <th>Text</th>\n        <th>Top</th>\n        <th>Left</th>\n    </tr>\n\n    <tr>\n        <td style=\"width: 200px\">Intro</td>\n        <td style=\"width: 200px\">Text</td>\n        <td style=\"width: 50px\">800</td>\n        <td style=\"width: 50px\">800</td>\n    </tr>\n    <tr>\n        <td style=\"width: 200px\">Intro 1</td>\n        <td style=\"width: 200px\">Text 1</td>\n        <td style=\"width: 50px\">400</td>\n        <td style=\"width: 50px\">400</td>\n    </tr>\n</table>\n","Anotations_ro":""}]
      
        • 41574
        • 14 Posts
        ok I just hit refresh on the resource editor and the table rows are now gone so I am assuming that html is not supposed to be recorded in the db.
          • 41574
          • 14 Posts
          Ok I am starting to understand what is going on here. When I edit the anotations, it takes the content of the anotations cell and provides that as the value. So it is trying to give me an HTML table as the value to edit but HTML is not JSON so that is why I don't see any rows when I try to edit the anotations. How do I configure it to grab the JSON rather than the HTML? Also, I don't know what I did to make it save the HTML in the db rather than JSON. How do I get that back to saving JSON?
            • 4172
            • 5,888 Posts
            use another fieldname for the annotations-column for example something like

            'renderannotations'

            Otherwise you will have the rendered output in your annotations-field
              -------------------------------

              you can buy me a beer, if you like MIGX

              http://webcmsolutions.de/migx.html

              Thanks!
              • 41574
              • 14 Posts
              Thanks a lot Bruno! It appears your suggestion has solved my problem!
                • 23849
                • 223 Posts
                I am having an issue when trying to use a Media Source for an image TV inside the Sub-migx configuration.

                When using getImageList via the 'value' parameter the resulting file and image variables are not appended with the required media source path.
                eg.
                Media Source Path = assets/img/library
                File = test.jpg
                Expected Output = assets/img/library/test.jpg
                Actual Output = test.jpg

                Bruno, can you provide some help here?
                  Nick Hoag
                  Creative Partner
                  The FutureForward

                  http://thefutureforward.com
                  • 23849
                  • 223 Posts
                  Fixed this by adding the "tvname" parameter to the sub-migx "getImageList" call.

                  Quote from: presson83 at Nov 04, 2013, 02:40 PM
                  I am having an issue when trying to use a Media Source for an image TV inside the Sub-migx configuration.

                  When using getImageList via the 'value' parameter the resulting file and image variables are not appended with the required media source path.
                  eg.
                  Media Source Path = assets/img/library
                  File = test.jpg
                  Expected Output = assets/img/library/test.jpg
                  Actual Output = test.jpg

                  Bruno, can you provide some help here?
                    Nick Hoag
                    Creative Partner
                    The FutureForward

                    http://thefutureforward.com
                    • 36516
                    • 179 Posts
                    Quote from: Bruno17 at Jan 01, 2013, 03:18 AM
                    use another fieldname for the annotations-column for example something like

                    'renderannotations'

                    Otherwise you will have the rendered output in your annotations-field

                    Hi Bruno. I've been trying renderChunk just recently, having found a need to have a standard migx inside another. All I want to do is display a thumbnail in the grid for an image TV that has a media source. All is well until I use renderChunk to display the thumb in the grid, and then things start getting weird.

                    First and most obviously, the Media Source is ignored so renderChunk is necessary so I can hardcode the asset path. A minor inconvenience given that I've used a Media Source to funnel those assets to a specific folder anyway.

                    Next, I note that you say I should use a different fieldname for the thumbnail column. I've found this to be necessary because if I don't, as I think you've tried to explain, I've found that the chunk is actually altering the data! At one point I tested with a renderChunk with only the word "test" inside. The result was that every time I edited a grid item and clicked "Done" the items in the grid would all be replaced with "test", which was then stored!

                    I have a question, and a problem. The question is, why would renderChunk have any ability to actually change the source data!? If it didn't, there'd be no need to use a different fieldname, and thus this whole process could be far more intuitive. It really doesn't seem to make sense to have a different fieldname, where previously the fieldname is what is required to hook up the data to the grid column. I read something you said before that seemed to imply there was some advantage to having the renderChunk exert some control over the data, but it seems unwise. Perhaps you could enlighten me. It'd be handy to have a read-only renderChunk so changing fieldnames counterintuitively wouldn't be necessary.

                    My ultimate problem is that having changed the fieldname and got it more or less working, I find that when using renderChunk, if I add more than one row to my sub-migx data set, something about renderChunk, or the chunk itself, is actually changing/corrupting the json data such that getImageList can no longer process and display it. Rogue output described below suggested a hidden field was being added, something with an "_ro" suffix.

                    Here's my sub-migx call in the chunk used for the root migx call:

                    [[!getImageList?
                          &tvname=`subMigxTV`
                          &value=`[[+subMigxFieldname]]`
                          &tpl=`subMigxItemTpl`]]
                    


                    Once I've added a couple of data rows using renderChunk and saved, the *frontend* output stops appearing, as if [[+subMigxFieldname]] is empty. If I put in an additional reference to [[+subMigxFieldname]] above the getImageList call (so there are two of the same placeholder in the chunk) it then prints out the raw json data within [[+subMigxFieldname]], immediately followed by the correct getImageList output.

                    [[+subMigxFieldname]]
                    [[!getImageList?
                          &tvname=`subMigxTV`
                          &value=`[[+subMigxFieldname]]`
                          &tpl=`subMigxItemTpl`]]
                    


                    Without the preceding [[+subMigxFieldname]] I get nothing at all. I've had similar problems in the past that have turned out to be caching issues, but I'm calling all my snippets uncached. Perhaps I've missed, or misunderstood something. Everything is fine until I add the image field, and associated grid column, using renderChunk with the following chunk, which I've pasted directly into the "renderChunk template" text area. I presume that's correct because it actually works until it starts messing up the source.

                    [[+image:notempty=`<img src="[[!phpthumbof? &input=`[[+image]]` &options=`w=60&h=60`]]"/>`]]


                    I get the impression everything would work just fine if I decide to drop the image column from the grid and not bother using renderChunk at all. In order to get things working again I've had to completely remove all the TVs involved. This presumably wipes, or at least ignores all that old data and starts over. I've rebuilt it without the image field and it's all fine so far. I need to work out how to render the image thumbnail in the grid, without altering the source data and without somehow causing this getImageList glitch.

                    Also, I can corroborate what "thefutureforward" says above, about getting an image TV media source to produce the correct image URL in this scenario. I've had to add &tvname to the getImageList parameters, eventhough I'm using &value and the documentation says &tvname will be ignored.

                    I have finally given the migx CMP a shot and find it to be excellent, though undocumented it seems. I wonder about the reference to "mediasources" when adding tab fields, and whether it should have some effect on this issue. It'd be nice to iron it out to make it a little easier still to use nested migx objects.

                    Thanks as ever for all your glorious work with migx. I consider it an integral part of Modx, and echo what others have said about it one day being included in the core. [ed. note: davidsmith last edited this post 10 years, 6 months ago.]