Skip to content

Theme.xml

Cameron edited this page Jan 28, 2017 · 1 revision

title: theme.xml permalink: /theme.xml/

Here's an example of theme.xml file, as used in e107 V2+. Unlike plugin.xml, it is not intended to replace a theme.php file, only work alongside it, to provide data about the theme itself. Various layouts can be configured and Menu-Presets created. Custompages are assigned in theme.xml. Adding $CUSTOMPAGES to theme.php in V2 is deprecated and should be avoided.

e107Theme

This is the namespace the configuration lives in, all theme.xml files must begin and end with this tag.

<e107Theme name="e107.v4" version="3.0" date="2012-01-07" compatibility="2.0" releaseUrl='http://www.mywebsite.com/e107_plugins/release/release.php'>
... all content belongs here ...
</e107Theme>

Key attributes of the theme are also defined here:

[mandatory]

The name of your theme. This can be text or a constant defined from your themes's language file.

<e107Theme name="DarkKnight" - Hardcoded text
<e107Theme name="THEME_NAME_CONSTANT" - Constant using language file

[mandatory]

The date when the theme was released.

<e107Theme .... date="2012-01-07" ...>

[mandatory]

The minimum version of e107 required to use the theme.

<e107Theme .... compatibility="2.0"  ...>

[optional]

The Url to the e107 'releases XML file' containing latest released version of the theme. e107 v2.0 comes with the 'release' plugin which will generate this xml file for you. This attribute allows admins to be notified of updates to themes within the admin area. (similar to core update notices)

<e107Theme .... releaseUrl="http://www.mywebsite.com/e107_plugins/release/release.php"  ...>

author

[mandatory]

Identifies you, and some information about you.

<author name="e107dev" url="http://e107.org/" email="blackhole@somwhere.com" />

Note the ' /' to close the tag at the end.

[mandatory]

Your name, e107 user name or nickname - your choice.

<...name="e107dev"

[mandatory]

Your e-mail address, useful to get feedback and bug reports on your theme. A mailto link to it is displayed on the Admin->Theme Manager page.

<...email="myname@mysite.com"

[optional]

Your website - advertise yourself! Displayed on the ''Admin->Theme Manager' page. A link to it is displayed on the ''Admin->Theme Manager' page.

<author .... url="http://www.mysite.com"  />

description

[mandatory]

A brief description of your theme. Displayed on the Admin->Theme Manager page.

<description>A dark theme suitable for gaming websites.</description>

Adding Plugin Options

[optional]

In this section, theme designers can include plugins that they intended to be used with the theme. In "Theme Manager" there will be a "Suggested Plugin:" section with buttons for those plugins that the user can click on to install them. These may often correspond with in the section titled "Layouts". We're using two (2) tags in this function that open and close and .

<pluginOptions>
Plugins you want to include go here using the <plugin /> format below.
</pluginOptions>

These are the plugins you want to users to be able to install from their "Theme Manager" and the location of the plugin folder. They go insde the tags above.

<plugin name='chatbox_menu' url='core' />
<plugin name='poll' url='core' />

Layout Section

[mandatory]

In this section, there don't have to be "menuPresets", but the layout does need to be defined to be used by "Theme Magnager" and "Menu Manager". The two tags used here are and . They can also optional tags for "menuPresets" functions described below.

[mandatory]

This is the basic layout. Even without any "menuPresets" in the theme.xml, all the menu areas in theme.php will be visible in "Menu Manager".

<layout name='3_column' title='3 Columns' preview='preview.jpg' previewFull='preview_full.png' default='true'>
</layout>
layout name

[mandatory]

The Name of the layout is in the

<layout name='3_column' ...</layout>
layout title

[mandatory]

The title of the layout is in the

<layout title='3 Columns' ...>
</layout>
layout preview

[optional]

The layout Preview is thumbnail of this layout

<layout preview='preview.jpg' ...</layout>
layout previewFull

[optional]

The layout previewFull is a full screenshot of that layout.

<layout  previewFull='preview_full.png' ...
</layout>
default

[mandatory]

This is naming the default layout. There can be only one and any layout not using it does not need to declare it's use at all. You can choose to specify that other pages use a different layout when the theme is installed by using .

<layout default='true'>
</layout>

Menu Presets

[optional]

Theme authors can create buttons for menus that can be activated by the user from "Menu Manager" or "Theme Manager". These are placed between and and should be enclosed in the and tags with the opening area tag naming the menu area it corresponds to; the example below would be for a layout with two (2) menu areas ({MENU=1} = and {MENU=2} = ). The tag "menu name" must contain the name of a valid and installed menu.

<menuPresets>
 <area id='1' >
  <menu name='login' />
  <menu name='compliance' />
  <menu name='online' perm='member' />
 </area>
 <area id='2'>
  <menu name='poll' />
  <menu name='powered_by' />
  <menu name='sitebutton' />
 </area>
</menuPresets>

Category:Theming Category:V2

Clone this wiki locally