Article

  • 6 years

    5 months

    YetiShare / Core

    3264

How to Create a New Yetishare Theme (v5)

How to Create a New Yetishare Theme (v5)

1) Create a new directory named your theme in /themes/. Lowercase alphanumeric and underscores only. i.e.

/themes/yourtheme/

2) Copy the contents of /themes/spirit/ into /themes/yourtheme/

3) In /themes/yourtheme/ThemeConfig.class.php replace the parameters:

'theme_name' => 'Spirit Theme', // the name of the theme
'folder_name' => 'spirit', // the folder name you just created
'theme_description' => 'Bootstrap Yetishare theme included with the core script.', // theme description shown in the admin area
'author_name' => 'YetiShare', // your name
'author_website' => 'https://yetishare.com', // support site if you're selling the theme

4) Rename /themes/yourtheme/ThemeSpirit.class.php to /themes/yourtheme/ThemeYourtheme.class.php, ensuring you make the first letter of the theme name uppercase and the rest lowercase.

5) Open /themes/yourtheme/ThemeYourtheme.class.php and change:

class ThemeSpirit extends Theme
to:

class ThemeYourtheme extends Theme

Change:

use Themes\Spirit\ThemeConfig;
to:

use Themes\Yourtheme\ThemeConfig;

6) Also update the namespace at the top of the files:

  • /ThemeConfig.class.php
  • /ThemeYourtheme.class.php
  • /controllers/FileController.class.php
  • /controllers/IndexController.class.php
  • /controllers/admin/ThemeController.class.php

Change:

namespace Themes\Spirit
to:

namespace Themes\Yourtheme

7) Open /views/admin/theme_settings.html.twig and change:

theme_settings/spirit
to:

theme_settings/yourtheme

8) You should now be able to enable the theme via your script admin area. The admin area thumbnail can be found in:

/themes/yourtheme/thumb_preview.png