Skip to content

Commit

Permalink
Merge pull request #33 from silverstripe-superchargers/feature/enable…
Browse files Browse the repository at this point in the history
…-css-classes

feature/enable-css-classes: reenabled css class configurability for SS4.
  • Loading branch information
benmanu authored Oct 2, 2019
2 parents c5d1b39 + d2d5454 commit 56f202b
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion code/ResponsiveImageExtension.php
Original file line number Diff line number Diff line change
Expand Up @@ -130,11 +130,17 @@ protected function createResponsiveSet($config, $defaultArgs, $set)
]));
}

if (isset($config['css_classes'])) {
$extraClasses = $config['css_classes'];
} else {
$extraClasses = Config::inst()->get(__CLASS__, 'default_css_classes');
}

$templatePath = isset($config['template']) ? $config['template'] : 'Includes/ResponsiveImageSet';

return $this->owner->customise([
'Sizes' => $sizes,

'ExtraClasses' => $extraClasses,
'DefaultImage' => $this->getResampledImage($methodName, $defaultArgs)
])->renderWith($templatePath);
}
Expand Down

0 comments on commit 56f202b

Please sign in to comment.