Upgrading legacy themes

Please note: This page is under construction and has not been finished yet.

Introduction

Themes developed for v1.x of e107 will continue to work using v2.x. However, to get the most out of v2.x, it is recommended to make the following changes to bring your theme up to date with the new v2.x standards.

theme.php

  • Replace $HEADER and $FOOTER with $HEADER['default'] and $FOOTER['default']

  • Replace any occurrences of $CUSTOMHEADER and $CUSTOMFOOTER with $HEADER['custom'] and $FOOTER['custom']

  • If your theme contains links to external social media pages such as Facebook, Twitter or YouTube, use the core definitions for them. ie. XURL_FACEBOOK, XURL_TWITTER, XURL_YOUTUBE.

  • Remove any reference to $CUSTOMPAGES and place them inside theme.xml in the layouts section.

<layout name='custom' title='Custom Pages'>
	<custompages>FRONTPAGE</custompages>
	<custompages>/forum/</custompages>
</layout>
  • If you have used index.php in your $CUSTOMPAGES list, use FRONTPAGE instead (see above)

  • The function theme_head() has been deprecated. Instead, use either e107::css() or e107::js() to include what you require in the header. (see bootstrap or other new core theme for examples)

  • Shortcodes need to be set to UPPERCASE in all occurrences in your theme.php file. ($register[] and everywhere else in theme.php)

Theme shortcodes

TIP: As of e107 v2.x, you no longer need separate xxxxxx.sc files inside your theme's folder. You can now include all your theme-specific shortcodes in a single file calledtheme_shortcodes.php.

Read more on theme shortcodes here:

Theme Shortcodes

Last updated