We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 40715
    • 13 Posts
    i face some problem when i use newQuery to Gallery class .

    in the template , i include a snippet that run
    something like that

    snippet
    $c = $modx->newQuery('galAlbum');
    $albums = $modx->getCollection('galAlbum',$c);  


    after the calling of snippet, i include a snippet that really "include" a php page below:

    php page
    require_once 'config.core.php';
    require_once MODX_CORE_PATH.'model/modx/modx.class.php';
    $modx = new modX();
    $modx->initialize('web');
     
    $c = $modx->newQuery('galAlbum');
    $albums = $modx->getCollection('galAlbum',$c);  


    but in the "include" page of php file , it cannot load the $modx->newQuery('galAlbum'); ,
    count($albums) return zero..