We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 41613
    • 8 Posts
    Hi,
    I have an Accordion that has a top level of Title and Image. The inner level is a list.
    So the html is:

    <!-- this is the top level title -->
    <h3><img src="[[+image]]" alt="#" class="justifyleft"/>
    <span class="acc-title">[[+title]]</span></h3>
    <div>
    <!-- this is the list contained in the accordion -->
    <ul class="bullet acc-text">
       <li><a href="[[+link]]" title="#">[[+listItem]]</a><li>
       <li><a href="[[+link]]" title="#">[[+listItem]]</a><li>
       <li><a href="[[+link]]" title="#">[[+listItem]]</a><li>
    </ul>
    

    I can't figure out how to get the list working with MIGX. I have the top section working fine but how do I integrate the content of the Accordion?

    Thanks

      • 4172
      • 5,888 Posts
      try it this way:
      <!-- this is the top level title -->
      <h3><img src="[[+image]]" alt="#" class="justifyleft"/>
      <span class="acc-title">[[+title]]</span></h3>
      <div>
      <!-- this is the list contained in the accordion -->
      <ul class="bullet acc-text">
      [[getImageList? &value=`[[+listItems]]` &tpl=`@CODE:<li><a href="[[+link]]" title="#">[[+listItem]]</a><li>`]]
      </ul>
        -------------------------------

        you can buy me a beer, if you like MIGX

        http://webcmsolutions.de/migx.html

        Thanks!
      • http://forums.modx.com/thread/88107/simple-nesting-in-migx

        The tpl for the outer MIGx TV has something like this
        [[getImageList? &value=`[[+innerMIGx]]` &tpl=`tplFAQ`]]

        where "innerMIGx" is the inner MIGx TV field name.
          Studying MODX in the desert - http://sottwell.com
          Tips and Tricks from the MODX Forums and Slack Channels - http://modxcookbook.com
          Join the Slack Community - http://modx.org
          • 41613
          • 8 Posts
          Hi Bruno/Sottwell,
          Thank you for your suggestions. I am doing something wrong because the list items are not displaying.
          Can i do this all with one migx tv?
          My migx TV is [[+accordionGrid]]:
          [
          {"caption":"Image and Title", "fields": [
            {"field":"image","caption":"Image","inputTVtype":"image"},
            {"field":"title","caption":"Title"}
          ]},
          {"caption":"Links List", "fields": [
            {"field":"listItem","caption":"List Item"},
            {"field":"link","caption":"Link"}
          ]}
          ]


          my chunk is [[$accordionGridTpl]] (I have the 'value=' as my migx tv...is that correct):
          <h3><img src="[[+image]]" alt="journalism work" class="justifyleft"/><span class="acc-title">[[+title]]</span></h3>
              <div>
          
          <ul class="bullet acc-text">
          [[getImageList? &value=`[[+accordionGrid]]` &tpl=`@CODE:<li><a href="[[+link]]" title="[[+title]]">[[+listItem]]</a><li>`]]
                  </ul>
              </div> 


          and the main chunk [[$accordion]] is;
          <div id="accordion">
              [[!getImageList?
              &tvname=`accordionGrid`
              &tpl=`accordionGridTpl`
              &docid=`11`]]</div>


          Your help with this is appreciated, thank you.
            • 4172
            • 5,888 Posts
            It should be a second MIGX-TV-field inside the outer MIGX-TV

            [
            {"caption":"Image and Title", "fields": [
              {"field":"image","caption":"Image","inputTVtype":"image"},
              {"field":"title","caption":"Title"}
            ]},
            {"caption":"Links List", "fields": [
              {"field":"listItems","caption":"List Items","inputTV":"listItems"}
            ]}
            ]


            and the listItems - TV (the second MIGX - TV) with
            [
            {"caption":"Links List", "fields": [
              {"field":"listItem","caption":"List Item"},
              {"field":"link","caption":"Link"}
            ]}
            ]
              -------------------------------

              you can buy me a beer, if you like MIGX

              http://webcmsolutions.de/migx.html

              Thanks!