We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 1331
    • 129 Posts
    When you use a Textarea in MIGX, it doesn’t allow you to use the return key, because that closes the open item. Can this be fixed easily?
      • 23018
      • 353 Posts
      @abelafonte
      We encounterd this behaviour just yesterday. Somehow I have the feeling this is something new. Can’t believe I never used a textarea before and didn’t notice.

      Edit: I found a solution, see post below

      New question,

      I’m trying to use MIGx inside a wayfinder template and experience a problem I don’t understand.

      My Wayfinder call:
      <!-- Create a list of thumbnails from the first item within each documents MIGx grid -->
      				[[!Wayfinder? 
      				   &startId=`4` 
      				   &level=`2` 
      				   &rowTpl=`Bildarchiv Thumbnails_all - wf.rowTpl` 
      				   &innerRowTpl=`Bildarchiv Thumbnails_all - wf.innerRowTpl` 
      				   &outerTpl=`Bildarchiv Thumbnails_all - wf.outerTpl` 
      				]]
      

      My innerRowTpl chunk:
      <!-- Bildarchiv Thumbnails_all - tpl -->
      <li id="item_[[+id]]" class="thumbnail" >
         <a href="[[~[[*id]]? &object=`[[+id]]`]]">
               <img 
                    class="[[!getImageList? 
      				&docid=`[[+id]]`
      				&tvname=`Details`
      				&tpl=`@CODE:[[+detail_format]]`
      				&limit=`1`]]"
      
                    src="[[phpThumbOf?
                             &input=`[[getImageList? 
      				&docid=`[[+id]]`
      				&tvname=`Details`
      				&tpl=`@CODE:[[+detail_image]]`
      				&limit=`1`]]`
                             &options=`&w=60&zc=0&f=jpeg&q=75` 
                             &onlysrc=`1`
                    ]]"
                    alt="[[+pagetitle]]"
               />
         </a>
      </li>
      


      I want to create a list of images originating from several documents inside the second level of a tree structure:

      Example document tree:
      * 1999
      * * Item_1
      * * Item_2
      * * Item_3
      * 2000
      * * Item_1
      * * Item_2
      * 2001
      * * Item_1
      * * Item_2
      * * Item_3
      * * Item_4

      The template chunk worked perfectly for a getResources Chunk but it turned out that the the order of items was completely messed up. getResources collected all results and THEN sorted them by menuindex. This mixed up results from different folders.

      * Item_1 (1999)
      * Item_1 (2000)
      * Item_1 (2001)
      * Item_2 (1999)
      * Item_2 (2000)
      ...

      What I wanted to have is:

      * Item_1 (1999)
      * Item_2 (1999)
      * Item_3 (1999)
      * Item_1 (2000)
      * Item_2 (2000)
      * Item_3 (2000)
      ...

      Because I wasn’t able to prevent that behaviour I decided to go for wayfinder and its hierarchical approach. But both getImageList snippets return no result so the class="" and src="" attributes of each img tag are empty.

      Any idea where I’m doing it wrong?

      Regards,

      pepebe
        Homepage: pepebe.de | MODX snippets (and other stuff) at github: https://gist.github.com/pepebe
        • 23018
        • 353 Posts
        OK, after writing down the whole thing the solution finally came out of the blue.

        1. Create a hierarchical list with wayfinder:
        				[[!Wayfinder? 
        				   &startId=`4` 
        				   &level=`2` 
        				   &rowTpl=`Bildarchiv Thumbnails_all - wf.rowTpl` // Note: this one just contains [[+wf.wrapper]]. therefore first level results are not displayed
        				   &innerRowTpl=`Bildarchiv Thumbnails_all - wf.innerRowTpl` // Note: This one is used second level items
        				   &outerTpl=`Bildarchiv Thumbnails_all - wf.outerTpl` 
        				]]
        NOTE: Make sure to remove the comments above...
        


        2. Use getResources WITHIN wayfinder innerRowTpl:
        	[[!getResources? 
        		&resources=`[[+id]]`
        		&tpl=`Bildarchiv Thumbnails_all - tpl`
        		&sortby=`menuindex`
        		&sortdir=`ASC` 
        		&context=`[[!returnContext]]` 
        		&limit=`0`
        		&depth=`0`
        		&includeTVs=`1`
        		&processTVs=`1` 
        		&tvPrefix=``
        		&includeContent=`1`
        		&format=`[[+objekt_format]]`
        	]]
        


        3. Use getImageList WITHIN getResources tpl:
        <!-- Bildarchiv Thumbnails_all - tpl -->
        <li 
            id="item_[[+id]]" 
            class="thumbs"
        >
        
           <a href="[[~[[*id]]? &object=`[[+id]]`]]">
        
                 <img 
                      class="[[!getImageList? 
        				&docid=`[[+id]]`
        				&tvname=`Details`
        				&tpl=`@CODE:[[+detail_format]]`
        				&limit=`1`]]"
        
                      src="[[phpThumbOf?
                               &input=`[[!getImageList? 
        				&docid=`[[+id]]`
        				&tvname=`Details`
        				&tpl=`@CODE:[[+detail_grafik]]`
        				&limit=`1`]]`
                               &options=`&w=60&zc=0&f=jpeg&q=75` 
                               &onlysrc=`1`
                      ]]"
                      alt="[[+pagetitle]]"
                 />
           </a>
        </li>
        


        Now everything works as expected. smiley

        I’m totally in love with MODx!

        pepebe
          Homepage: pepebe.de | MODX snippets (and other stuff) at github: https://gist.github.com/pepebe
          • 4172
          • 5,888 Posts
          Because I wasn’t able to prevent that behaviour I decided to go for wayfinder and its hierarchical approach.
          its possible with getResources and a helper-snippet, which does the sorting, see this discussion:
          http://www.modxcms.de/forum/comments.php?DiscussionID=4988&page=1#Item_28
            -------------------------------

            you can buy me a beer, if you like MIGX

            http://webcmsolutions.de/migx.html

            Thanks!
            • 9673
            • 52 Posts
            Hello every!
            I have trouble with installation, i show my step-by-step.
            I want have mini gallery in one TV.
            How install necessary correct?
            I read http://rtfm.modx.com/display/ADDON/MIGX.Backend-Usage , but did not understand, where take fields "Form Tabs" and "Grid Columns"? Where exemple these fields, i know. I not know, where i must paste this? I do not see these field.
            English i not know, i used google translate. I not understand documentation sad
            Please help me install MIGX
              • 4172
              • 5,888 Posts
              If you are using Revo 2.0.8 you can import the example properties from /core/components/migx/examples/example.properties.before.2.1.js

              I think it’s better to upgrade to Revo 2.1.x. Then you can use the new input-properties for TVs.
                -------------------------------

                you can buy me a beer, if you like MIGX

                http://webcmsolutions.de/migx.html

                Thanks!
                • 9673
                • 52 Posts
                I updated to Revo 2.1.1 Now fields see.

                I create 3 TV.
                1) name:multiItemsGrid, type:MIGX. chose checkbox for template;
                2) name:images, type:images;
                3) name:richtext, type:richtext;

                Now i see, normal condition TV. (screen 1)

                I add an image. (screen 2)

                This i see, when added two image (screen 3)

                This i see, when calling the snippet (screen 4)

                My code call snippet (this for view error return): [[*getImageList]]

                Snipet return: ([{"title":"1","description":"1","image":""},{"title":"2","description":"2","image":""}] )

                The problem is that no link image. where I go wrong?

                Form Tabs: [
                {"caption":"Info", "fields": [
                {"field":"title","caption":"Title"},
                {"field":"description","caption":"Description","inputTV":"richtext"}
                ]},
                {"caption":"Image", "fields":[
                {"field":"image","caption":"Image","inputTV":"image"},
                {"field":"image","caption":"Image small","inputTV":"image_small"}
                ]}
                ]

                Grid Columns:[
                {"header": "Title", "width": "160", "sortable": "true", "dataIndex": "title"},
                {"header": "Image", "width": "50", "sortable": "false", "dataIndex": "image","renderer": "this.renderImage"}
                ]
                  • 4172
                  • 5,888 Posts
                  when you have:

                  2) name:images, type:images;


                  then you need in Form Tabs:

                  [
                  {"caption":"Info", "fields": [
                      {"field":"title","caption":"Title"},
                      {"field":"description","caption":"Description","inputTV":"richtext"}
                  ]},
                  {"caption":"Image", "fields":[
                      {"field":"image","caption":"Image","inputTV":"images"},
                     {"field":"image_small","caption":"Image small","inputTV":"images"}
                  ]}
                  ]


                  or when you have:

                  2) name:image, type:image;


                  then you need in Form Tabs:

                  [
                  {"caption":"Info", "fields": [
                      {"field":"title","caption":"Title"},
                      {"field":"description","caption":"Description","inputTV":"richtext"}
                  ]},
                  {"caption":"Image", "fields":[
                      {"field":"image","caption":"Image","inputTV":"image"},
                     {"field":"image_small","caption":"Image small","inputTV":"image"}
                  ]}
                  ]
                    -------------------------------

                    you can buy me a beer, if you like MIGX

                    http://webcmsolutions.de/migx.html

                    Thanks!
                    • 9673
                    • 52 Posts
                    Oy sorry, i was wrong.
                    Correct not "2) name:images, type:images;", is true "2) name:image, type:image;"

                    the rest is all correct
                      • 4172
                      • 5,888 Posts
                      ok, then you need in Form Tabs:

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


                      you need unique-field-names, but can use the same inputTV for multiple fields
                        -------------------------------

                        you can buy me a beer, if you like MIGX

                        http://webcmsolutions.de/migx.html

                        Thanks!

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