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

    I have the following call on a template

    <ol>
    [[!getPage@blogProp? &element=`getResources` &parents=`47` &where=`{"template:=":8}` &tpl=`blogList.Tpl` &sortby=`publishedon`]]
    </ol>
    <div class="pagination">
    [[!+page.nav]]
    </div>
    


    But it's just ignoring the property set. If I run this via a custom snippet then the property set is used. For example

    <?php
    $params = array(
      'element' => 'getResources',
      'parents' => 47,
      'tpl' => 'blogList.Tpl',
      'limit' => 4,
      'sortby' => 'publishedon',
      'where' => '{"template:=":8}'
    );
    
    $propSet = $modx->getObject('modPropertySet',array(
            'name' => 'blogProp'));
    #print '<pre>'; print_r($params); print '</pre>';
    return $modx->runSnippet('getPage', array_merge($propSet->getProperties(), $params));
    


    Anyone else had issues with property sets?

    I'm running modx 2.3.2

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

    • discuss.answer
      • 3749
      • 24,544 Posts
      To use the @ specification, the property set has to be "attached" to the element in Tools -> Property sets, or created on the Properties tab of the element itself (which attaches it automatically).
        Did I help you? Buy me a beer
        Get my Book: MODX:The Official Guide
        MODX info for everyone: http://bobsguides.com/modx.html
        My MODX Extras
        Bob's Guides is now hosted at A2 MODX Hosting
        • 36926
        • 701 Posts
        Great thanks Bob, is this a new thing in 2.3? As don't recall doing this before, but don't often use property sets.
          • 3749
          • 24,544 Posts
          No, AFAIK, it's always been the case in Revo (there's a section on it in my book). If you create the property set on the Properties tab of the element, it happens automatically, so maybe that's why you haven't noticed it.

            Did I help you? Buy me a beer
            Get my Book: MODX:The Official Guide
            MODX info for everyone: http://bobsguides.com/modx.html
            My MODX Extras
            Bob's Guides is now hosted at A2 MODX Hosting