10378 Posts in 2194 Topics by 1710 members
|
Page:
1
|
Go to End | |
| Author | Topic: | 669 Views |
-
Customizing the Default Array for Image Gallery in the Config

28 October 2009 at 1:52am
I'm trying to alter the defaults in the Image gallery page (ie the album width, height, etc). I would like to do so in the config file so that I can upgrade to future versions easily. I believe I can do this through a DataObjectDecorator, but I'm lost on the exact way to do so, and have found little to no documentation. Here is my code this far...
ImageGalleryDecorator
class ImageGalleryDecorator extends DataObjectDecorator {
static $defaults = array (
'CoverImageWidth' => '140',
'CoverImageHeight' => '140'
);
}_config.php
DataObject::add_extension("ImageGalleryPage","ImageGalleryDecorator");
Could something like this work? Does anyone have any ideas, or can point me in the right direction? Thanks in advance.
-
Re: Customizing the Default Array for Image Gallery in the Config

28 October 2009 at 3:10am Last edited: 28 October 2009 3:11am
You don't need a decorator for that.
_config.php
singleton("ImageGalleryPage")->set_stat('defaults',array(
// etc...
));If you were to use a decorator, though, you would use:
function extraStatics() {
return array (
'defaults' => array(
// etc..
);
)
} -
Re: Customizing the Default Array for Image Gallery in the Config

28 October 2009 at 3:30am
Ah, that worked, thanks!
| 669 Views | ||
|
Page:
1
|
Go to Top |

