BobRay / MyComponent

Development environment for creating MODX extras
https://bobsguides.com/mycomponent-tutorial.html
23 stars 13 forks source link

'allStatic' => true Does nothing #19

Closed jmaddington closed 10 years ago

jmaddington commented 11 years ago

Setting

'allStatic' => true,

in config file does not actually result in static elements. Overriding on each element still works, however.

BobRay commented 11 years ago

I think I removed that because I had trouble with static plugins. Have you used those successfully?

You could try adding this code at line 212 of the addToModx() method in the core\components\mycomponent\model\mycomponent\elementadapter.class.php file -- just below $fields = $this->myFields;

    $class = $this->getClass();
    $allStatic = $this->modx->getOption('allStatic', $this->helpers->props, false);
    if (($class != 'modPropertySet') && ($class != 'modPlugin') && $allStatic) {
        $fields['static'] = true;
    }

To do plugins too, remove && ($class != 'modPlugin')

Let me know if this works and whether you've used static plugins with no trouble.

jmaddington commented 11 years ago

I've never tried to do a static plugin.

Really, it doesn't matter a whole lot personally -- the per-item override works fine -- you just said you wanted to know about bugs.

On Sun, Sep 15, 2013 at 2:07 AM, BobRay notifications@github.com wrote:

I think I removed that because I had trouble with static plugins. Have you used those successfully?

You could try adding this code at line 212 of the addToModx() method in the core\components\mycomponent\model\mycomponent\elementadapter.class.php file -- just below $fields = $this->myFields;

$class = $this->getClass();
$allStatic = $this->modx->getOption('allStatic', $this->helpers->props, false);
if (($class != 'modPropertySet') && ($class != 'modPlugin') && $allStatic) {
    $fields['static'] = true;
}

To do plugins too, remove && ($class != 'modPlugin')

Let me know if this works and whether you've used static plugins with no trouble.

— Reply to this email directly or view it on GitHubhttps://github.com/BobRay/MyComponent/issues/19#issuecomment-24465082 .