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

    now I need some help myself, or at least an opinion. I am currently experiencing a very awkward error.
    I am running 2.0.8pl with migx installed through the package management and have created the following:

    a TV called bg-image, type image, output text
    a TV called migx-bg-images, type migx, output text
    property "formtabs" (textarea):
    [ {"header": "Image", "dataIndex": "image", "renderer": "this.renderImage"} ]

    property "columns" (textarea):
    [ {"caption":"Image", "fields":[     {"field":"image","caption":"Image","inputTV":"bg-image"} ]} ]


    This gives me the desired backend features. Everything fine. I can add and remove and sort as many images as I want.

    However,..

    The frontend is not working. I created:

    a chunk called bg-image-tpl (after using @CODE, but they both behave absolutely the same, no difference):
    <img src="[[+image]]"/>


    in my page-header chunk i added the following lines:
    <div id="background-image">
      [[!getImageList? &tvname=`migx-bg-images` &tpl=`bg-image-tpl` &limit=`1`]]
    </div>​


    And this is still great! It works, but only as long as I add only one image to the migx TV.

    Now, the weird thing is, that if I add two images, the generated sourcecode still seems to be correct! If I view it in the browser I get the expected output:
    <div id="background-image"> 
      <img src="/assets/images/beached.jpg"/> 
    </div>


    It is completely irrelevant how many images there are (notice the limit-option on the getImageList call).

    But, on the site, the image is not showing up. And firebug (or the equivalent of google chrome) shows the following code:
    <div id="background-image"></div>


    So there is a difference between firebug and the "show sourcecode" function of the browser?!

    Any ideas? This has been keeping me busy for hours..

    Any help is very appreciated, thanks!

    Simon

    UPDATE 1:

    [[*migx-bg-images]] outputs (if two images are added to the TV):
    [{"image":"/assets/images/beached.jpg"},{"image":"assets/images/london_roof.jpg"}]


    UPDATE 2:

    I made a diff of the the html file with one image added and the html file with two images added. There is NO difference!! However, one displays it in firebug and on the site, the other one doesn’t..
      • 4172
      • 5,888 Posts
      is it online?
        -------------------------------

        you can buy me a beer, if you like MIGX

        http://webcmsolutions.de/migx.html

        Thanks!
        • 32873
        • 9 Posts
        Bruno: I’ve send you emails.

        Forum: If we get anywhere with this, I will post the solution here!
          • 32873
          • 9 Posts
          As so often, the problem was between screen and keyboard. I had an old line of javascript that caused the error (although that should still cause a different error)! wink

          So, thanks everyone, problem solved!

          Simon
            • 14951
            • 151 Posts
            Wish MIGX had it’s own category to post under in the forums so as not to keep using this single post. Anyhow... I was wondering if there is anyway to "filter" items based upon a category tv.

            For example, I will have a single MIGX tv with the following fields:

            Category: Dropdown Menu with preset options (e.g. Mammals, Amphibians...)
            Title: Text Input

            For simplicities sake, let’s pretend my categories are just 1,2,3,4,5.

            Ideally, I’d like to be able to for example call:
            <ul>[[!getImageList? &tvname=`myTV` &tpl=`<li>[[+title]]</li>` &category=`1`]]</ul>

            and it would display only the items that have category 1 selected from the dropdown.

            Does this make any sense? Is it possible?

            Thanks in advance for any insight!
            -Jared
              • 4172
              • 5,888 Posts
              you can try the latest from github with:

              [[!getImageList? &tvname=`myTV` &tpl=`@CODE:<li>[[+title]]</li>` &where=`{"category":"1"}`]]


              its also possible to search by commaseparated lists with

              [[!getImageList? &tvname=`myTV` &tpl=`@CODE:<li>[[+title]]</li>` &where=`{"category:IN":"1,3,4"}`]]


              or multiple fields with:

              [[!getImageList? &tvname=`myTV` &tpl=`@CODE:<li>[[+title]]</li>` &where=`{"category":"1","title":"thistitle"}`]]
                -------------------------------

                you can buy me a beer, if you like MIGX

                http://webcmsolutions.de/migx.html

                Thanks!
                • 1331
                • 129 Posts
                This is probably the most superb addon since Wayfinder!

                Anyway, I have a suggestion: Maybe there could be a way for us to mark list items in the MIG as ’inactive’ so they don’t specifically have to be removed in order to be excluded from the list.
                  • 4172
                  • 5,888 Posts
                  Quote from: abelafonte at May 24, 2011, 06:59 PM

                  This is probably the most superb addon since Wayfinder!

                  Anyway, I have a suggestion: Maybe there could be a way for us to mark list items in the MIG as ’inactive’ so they don’t specifically have to be removed in order to be excluded from the list.

                  just create a checkbox-TV ’active’ with input-options: yes==1

                  and add it to one of the form-tabs. For example:

                  [
                  {"caption":"Info", "fields": [
                      {"field":"title","caption":"Title"},
                      {"field":"description","caption":"Description","inputTV":"richtext"},
                      {"field":"active","caption":"Active","inputTV":"active"}
                  ]},
                  {"caption":"Image", "fields":[
                      {"field":"image","caption":"Image","inputTV":"image"}
                  ]}
                  ]
                  


                  and with the latest getImageList - snippet from github:

                  [[!getImageList? &tvname=`myTV` &tpl=`@CODE:<li>[[+title]]</li>` &where=`{"active":"1"}`]]
                    -------------------------------

                    you can buy me a beer, if you like MIGX

                    http://webcmsolutions.de/migx.html

                    Thanks!
                    • 1331
                    • 129 Posts
                    nice! i’ll have to give this a go.
                      • 14951
                      • 151 Posts
                      Quote from: Bruno17 at May 24, 2011, 03:54 AM

                      you can try the latest from github with...

                      Bruno..this works beautifully! Except for one small oddity.. If I do multiple calls on a single resource...whatever happens to be the last call gets a random "1" prior to listing the items. The "1" isn’t placed within the template, it’s just a complete standalone "1", and seemingly no matter what order I call things, whatever happens to be the last getImageList call gets the "1" issue.

                      Any ideas?

                      Thanks!
                      -Jared

                      This discussion is closed to further replies. Keep calm and carry on.