We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 28107
    • 230 Posts
    I have - simplified- a table with IDs of resources in a migx_table

    [[+id-of-a-resource]] stores Ids of some resources

    Now I want to output the pagetitle of these ids

    [[!migxLoopCollection?
    &packageName=`list-of-something`
    &classname=`list-of-something`
    &tpl=`@CODE:Name of resource is: [[getResourceField? &id=`[[+id-of-a-resource]]`]]`
    ]]
    


    That does not work - it's monday - and I'm a blockhead
      CONIN Werbeagentur . Köln
      http://www.conin.de
      • 4172
      • 5,888 Posts
      first off. Does this output anything?
      [[!migxLoopCollection?
      &packageName=`list-of-something`
      &classname=`list-of-something`
      ]]
      


      If so. What?

      And how does your db-schema look like for that table.
      Perhaps we can do a join and we can get the pagetitles with one db-query together with the table's fields.
        -------------------------------

        you can buy me a beer, if you like MIGX

        http://webcmsolutions.de/migx.html

        Thanks!
        • 28107
        • 230 Posts
        Moin,

        If I change the code to

        [[!migxLoopCollection?
        &packageName=`list-of-something`
        &classname=`list-of-something`
        &tpl=`@CODE:Name of resource is: [[getResourceField? &id=`3`]]`
        ]]
        


        the getresource-call is rendered and everything is fine.

        the [[+id-of-a-resource]] is an integer.
          CONIN Werbeagentur . Köln
          http://www.conin.de
          • 4172
          • 5,888 Posts
          not sure, if you have an aggregate to modResource with an alias for example of 'Resource' in your db-schema.

          If so, you can try:

          [[migxLoopCollection?
          &packageName=`list-of-something`
          &classname=`list-of-something`
          &joins=`[{"alias":"Resource","selectfields":"id,pagetitle"}]`
          &tpl=`@CODE:Name of resource is: [[+Resource_pagetitle]]`
          ]]


          If not you can join with:

          [[migxLoopCollection?
          &packageName=`list-of-something`
          &classname=`list-of-something`
          &joins=`[{"alias":"Resource","classname":"modResource","on":"Resource.id=list-of-something.id-of-a-resource","selectfields":"id,pagetitle"}]`
          &tpl=`@CODE:Name of resource is: [[+Resource_pagetitle]]`
          ]]


          this should be faster than having a getResourceField - call at each row.
            -------------------------------

            you can buy me a beer, if you like MIGX

            http://webcmsolutions.de/migx.html

            Thanks!
            • 28107
            • 230 Posts
            Hi Bruno,

            sry for the delay. will check that out. many thx.

            Wenn's funkt, haste ein Kölsch bei mir gut.
              CONIN Werbeagentur . Köln
              http://www.conin.de