phowie74
10/16/2017 - 5:26 PM

Page Theme Master

Fully loaded version of the Page Theme file

<?php 
/* the theme folder name: */
//- must be lowercase
//- cannot use spaces
//- cannot use hyphens
//- underscores can be used to separate words
//Example:
//theme_folder_name -> ThemeFolderName

namespace Application\Theme\ThemeFolderName;

/* BASIC - WITH NO GRID REQUIRMENTS */
//class PageTheme extends \Concrete\Core\Page\Theme\Theme { 

/* ENABLE GRID FUNCTIONALITY */
use Concrete\Core\Area\Layout\Preset\Provider\ThemeProviderInterface;
class PageTheme extends \Concrete\Core\Page\Theme\Theme implements ThemeProviderInterface {

    protected $pThemeGridFrameworkHandle = 'bootstrap3'; /* built in grids - bootstrap2, bootstrap3, foundation, 960 */

/* use / override built in scripts */
    public function registerAssets()
    {

	    $this->requireAsset('javascript', 'jquery');
	    $this->requireAsset('javascript', 'picturefill');
	    $this->requireAsset('javascript-conditional', 'html5-shiv');	    
      $this->requireAsset('javascript-conditional', 'respond');

      $this->requireAsset('css', 'font-awesome');
      $this->requireAsset('responsive-slides'); /* SCRIPT & CSS */
      $this->requireAsset('core/lightbox'); /* SCRIPT & CSS */

/* Bootstrap included with Theme CSS / JS? */      
      $this->providesAsset('css', 'bootstrap/*');
      $this->providesAsset('javascript', 'bootstrap/*');
      $this->providesAsset('css', 'core/frontend/*'); /* if bootstrap is not namespaced to ccm-page */

/* Don't load additional css for particula block types */
      $this->providesAsset('css', 'blocks/form');
      $this->providesAsset('css', 'blocks/topic_list');

      $this->providesAsset('css', 'blocks/social_links');
      $this->providesAsset('css', 'blocks/share_this_page');
      $this->providesAsset('css', 'blocks/feature');
      $this->providesAsset('css', 'blocks/testimonial');
      $this->providesAsset('css', 'blocks/date_navigation');
      $this->providesAsset('css', 'blocks/faq');
      $this->providesAsset('css', 'blocks/tags');
      $this->providesAsset('css', 'core/frontend/*');
      $this->providesAsset('css', 'blocks/feature/templates/hover_description');

    }


    public function getThemeName()
    {
        return t('THEME-TITLE');
    }

    public function getThemeDescription()
    {
        return t('Custom Concrete5 theme created by Bluegreen Design for THEME-TITLE');
    }



/* set default Template for block types */
    public function getThemeDefaultBlockTemplates()
    {
        return array(
            'calendar' => 'bootstrap_calendar.php'
        );
    }

/* set available classes for Blocks */
    public function getThemeBlockClasses()
    {
        return array(
            'feature' => array('feature-home-page'),
            'page_list' => array(
                'recent-blog-entry',
                'blog-entry-list',
                'page-list-with-buttons',
                'block-sidebar-wrapped',
            ),
            'next_previous' => array('block-sidebar-wrapped'),
            'share_this_page' => array('block-sidebar-wrapped'),
            'content' => array(
                'block-sidebar-wrapped',
                'block-sidebar-padded',
            ),
            'date_navigation' => array('block-sidebar-padded'),
            'topic_list' => array('block-sidebar-wrapped'),
            'testimonial' => array('testimonial-bio'),
            'image' => array(
                'image-right-tilt',
                'image-circle',
            ),
        );
    }

/* set sizes for responsive images */
    public function getThemeResponsiveImageMap()
    {
        return array(
            'large' => '900px', /* 1140px image */
            'medium' => '768px', /* 940px image */
            'small' => '0', /* 740px image */
        );
    }

/* set custom styles for content editor */
    public function getThemeEditorClasses()
    {
        return array(
/* v5.7 */
          array('title' => t('Lead Text'), 'menuClass' => 'lead', 'spanClass' => 'lead', 'forceBlock' => 1),
          array('title' => t('Highlight Text'), 'menuClass' => 'highlight', 'spanClass' => 'highlight', 'forceBlock' => 1),
          array('title' => t('Muted Text'), 'menuClass' => 'text-muted', 'spanClass' => 'text-muted', 'forceBlock' => -1),
          array('title' => t('Small Text'), 'menuClass' => 'small', 'spanClass' => 'small', 'forceBlock' => -1),
          array('title' => t('Small Muted Text'), 'menuClass' => 'small text-muted', 'spanClass' => 'small text-muted', 'forceBlock' => -1),
          array('title' => t('Header Underline'), 'menuClass' => 'header-underline', 'spanClass' => 'header-underline', 'forceBlock' => 1),
          array('title' => t('Button'), 'menuClass' => 'btn btn-manners', 'spanClass' => 'btn btn-manners', 'forceBlock' => -1),
          array('title' => t('Button Alt'), 'menuClass' => 'btn btn-manners-alt', 'spanClass' => 'btn btn-manners-alt', 'forceBlock' => -1)
/* v5.8 */
			array(
				'title' => t('Lead Text'),
				'element' => array('h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'p'),
				'attributes' => array('class' => 'text-lead')
			),
			array(
				'title' => t('Highlight Text'),
				'element' => array('h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'p', 'span'),
				'attributes' => array('class' => 'text-highlight')
			),
			array(
				'title' => t('Small Text'),
				'element' => array('h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'p', 'span'),
				'attributes' => array('class' => 'text-small')
			),
			array(
				'title' => t('Muted Text'),
				'element' => array('h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'p', 'span'),
				'attributes' => array('class' => 'text-muted')
			),
			array(
				'title' => t('Small Muted Text'),
				'element' => array('h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'p', 'span'),
				'attributes' => array('class' => 'text-small text-muted')
			),
			array(
				'title' => t('Highlight Box'),
				'element' => 'div',
				'attributes' => array('class' => 'box')
			),
			array(
				'title' => t('Dark Box'),
				'element' => 'div',
				'attributes' => array('class' => 'box-dk')
			),
			array(
				'title' => t('Button'),
				'element' => array('a', 'span'),
				'attributes' => array('class' => 'btn')
			),
			array(
				'title' => t('Outline Button'),
				'element' => array('a', 'span'),
				'attributes' => array('class' => 'btn btn-outline')
			)

        );
    }

/* set available classes for Areas */
    public function getThemeAreaClasses()
    {
        return array(
            'Page Footer' => array('area-content-accent'),
        );
    }

/* set pre-defined layout options for area */
    public function getThemeAreaLayoutPresets()
    {
    $presets = array(
      array(
        'handle' => 'left_sidebar',
        'name' => 'Left Sidebar',
        'container' => '<div class="row"></div>',
        'columns' => array(
          '<div class="col-xs-12 col-sm-7"></div>',
          '<div class="col-xs-12 col-sm-4 col-sm-offset-1"></div>'
        ),
      ),
      array(
        'handle' => 'right_sidebar',
        'name' => 'Right Sidebar',
        'container' => '<div class="row"></div>',
        'columns' => array(
  '<div class="col-xs-12 col-sm-7 col-sm-push-5"></div>',
  '<div class="col-xs-12 col-sm-4 col-sm-pull-7"></div>'
        ),
      ),
      array(
        'handle' => 'half_half',
        'name' => 'Half & Half',
        'container' => '<div class="row"></div>',
        'columns' => array(
          '<div class="col-xs-12 col-sm-6"></div>',
          '<div class="col-xs-12 col-sm-6"></div>'
        ),
      ),
      array(
        'handle' => 'three_column',
        'name' => 'Three Column',
        'container' => '<div class="row"></div>',
        'columns' => array(
          '<div class="col-xs-12 col-sm-4"></div>',
          '<div class="col-xs-12 col-sm-4"></div>',
          '<div class="col-xs-12 col-sm-4"></div>'
        ),
      )
    );
    return $presets;
    }
}