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

    i use migxloopcollection to get a list of resources. i would like to use different templates for each item.
    getImageList has the option &tpl=`@Field:…`

    I tried to use it for migxloopcollection, but it doesn't work. Now i am not sure if it is not supported or if i am doing something wrong (i tried it first with one item):

    The Snippet Call
    [[!migxLoopCollection?
    		&classname=`modResource`
    		&joins=`[
    {"alias":"presentationStyle","classname":"modTemplateVarResource","on":"presentationStyle.contentid=modResource.id AND presentationStyle.tmplvarid=46"}
    		]`
    		&selectfields=`id,pagetitle,introtext`
    			
    		[[- <!-- search -->]]
    		&where=`[
    			{"published":"1"},
    			{"parent":"[[*id]]"},
    			{"template:=":"10","OR:template:=":"12","OR:template:=":"11"}
    		]`
    			
    		[[- <!-- sort -->]]
    		&sortConfig=`[{"sortby":"menuindex","sortdir":"ASC"}]`
    		
    		&tpl=`@Field:presentationStyle.value`
    	]]


    The Result for presentationStyle.value
    product-listing-default

    The name of the chunk
    product-listing-default

    tried it with this &where to check presentationStyle.value (delivers the right result)
    [[- <!-- search -->]]
    		&where=`[
    			{"published":"1"},
    			{"parent":"[[*id]]"},
    			{"template:=":"10","OR:template:=":"12","OR:template:=":"11"},
    			{"presentationStyle.value:=":"product-listing-default"}
    		]`

    This question has been answered by Bruno17. See the first response.

      • 4172
      • 5,888 Posts
      the output-rendering - loop is the same of getImageList and migxLoopCollection.

      try :
      @FIELD:
      not
      @Field:
        -------------------------------

        you can buy me a beer, if you like MIGX

        http://webcmsolutions.de/migx.html

        Thanks!
      • discuss.answer
        • 4172
        • 5,888 Posts
        try also:

        @FIELD:presentationStyle_value
          -------------------------------

          you can buy me a beer, if you like MIGX

          http://webcmsolutions.de/migx.html

          Thanks!
          • 4172
          • 5,888 Posts
          also instead of this

          {"template:=":"10","OR:template:=":"12","OR:template:=":"11"}


          use this:

          {"template:IN":[ 10,11,12 ]}
            -------------------------------

            you can buy me a beer, if you like MIGX

            http://webcmsolutions.de/migx.html

            Thanks!
            • 45766
            • 78 Posts
            Urgs. Looked to long at the code and was blind wink

            Thanks!!!