Skip to content

Commit

Permalink
Added option to change the base section class
Browse files Browse the repository at this point in the history
  • Loading branch information
gorriecoe committed Oct 9, 2016
1 parent 7b95157 commit e871b55
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion code/models/Section.php
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,8 @@ class Section extends DataObject implements PermissionProvider
'Pages' => 'Page'
);

private static $base_class = 'section';

/**
* @var SectionController
*/
Expand Down Expand Up @@ -265,7 +267,7 @@ public function AnchorAttr(){
* @return string $classes
*/
public function Classes(){
$classes = array('section');
$classes = array($this->config()->get('base_class'));
if ($this->Style) {
$classes[] = strtolower($this->Style).'-'.strtolower(preg_replace('/([a-z]+)([A-Z0-9])/', '$1-$2', get_called_class()));
}else{
Expand Down

0 comments on commit e871b55

Please sign in to comment.