We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 37929
    • 18 Posts
    Hello, I am new with properties and property sets !

    I would like to generate a dynamic .css file using an inline modx document resource with "empty" template.

    But how could I access to the default properties of the BaseTemplate when I'm parsing the dynamic css resource that has an "empty" template ?

    As far as i know there are several classes to access to the properties , modPropertySet, modElementPropertySet, but i can't find the class for the default properties, and the difficulty for me now is to understand the doc, and there are only a few usage examples.

    what follows is completely wrong :

        $mq = $modx->newquery( 'modPropertySet' );// <= what is the class for default properties ???
    
        //$mq->select(array( 'modPropertySet.*' ));
    
        $settings = $modx->getIterator( 'modPropertySet',$mq );
    
        if ( $settings ) {
    
            $ph = array();
    
            foreach($settings as $setting){
    
                $md = $setting->toArray();
    
                $ph =$modx->getChunk( 'msgCss' );
    
                $modx->toPlaceholders($md, $msg_ph_prefix);
    
            }
    
        $modx->setPlaceholders(array( 'output' => $output, ), $prefix.'.' );
    
        return $output;
    


    Any help appreciated ! thanks a lot ! [ed. note: tulavu last edited this post 14 years, 7 months ago.]
      • 3749
      • 24,544 Posts
      You could do this:

      $props=$mq->getProperties();


      But wouldn't it be easier to put the CSS in a file or a chunk?



        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
        • 37929
        • 18 Posts
        thanks Bob, it was so easy

        the css with [[+properties]] are in a chunk.