A theme is a JSON file that contains instructions on how the content of your website will be rendered. In addition, a theme establishes the types you can use to classify each piece of content on your website. Each of these types has associated templates, which allow you to display or hide some of the information stored in the database. Finally, a theme contains strings that are used for internationalization.
There are 5 basic page types: Mainpage, Article, Series, Section and Author. The last four can be extended. For example, in the Default Theme, there are 3 types of Article: Article, Page and Analysis. Each of them can access all the information available for the basic Article type and decide to display only what is relevant. More details on what can be displayed on each page can be found in the Templates section of the application.
Page components don't have their own pages, but they do have an HTML template and a CSS template. They can be embedded in any page. Relations don't have associated pages or templates, but their data can be accessed within the HTML templates of the pages that extend the basic Article type.
The Mainpage CSS template is inserted into all other pages, making it the default place for global style definitions. The CSS templates of all page_components are also currently being inserted into all pages ( <link rel='stylesheet' href='/css/page_component_name.css'>
), even when not used. Therefore, avoid using conflicting names for CSS classes and HTML element IDs in pages and page components.
Below is a general outline of the structure of a theme:
{
"theme_uri": "sample_theme",
"image": "data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0idXRmLTgiPz48IS0tIFVwbG9hZGVkIHRvOiBTVkcgUmVwbywgd3d3LnN2Z3JlcG8uY29tLCBHZW5lcmF0b3I6IFNWRyBSZXBvIE1peGVyIFRvb2xzIC0tPgo8c3ZnIHdpZHRoPSI4MDBweCIgaGVpZ2h0PSI4MDBweCIgdmlld0JveD0iMCAwIDQwMCA0MDAiIGZpbGw9Im5vbmUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+DQo8cGF0aCBkPSJNMTYzLjc5MSAxNzIuNDExQzE2Mi4xNjEgMTYwLjM4IDE2NC42NTggMTQ1Ljg1IDE2NS4zMzggMTM1IiBzdHJva2U9IiMwMDAwMDAiIHN0cm9rZS1vcGFjaXR5PSIwLjkiIHN0cm9rZS13aWR0aD0iMjAiIHN0cm9rZS1saW5lY2FwPSJyb3VuZCIgc3Ryb2tlLWxpbmVqb2luPSJyb3VuZCIvPg0KPHBhdGggZD0iTTIzMy4xNDMgMTcwLjk3QzIzMy4yOTYgMTU5LjYwMiAyMzMuNDM2IDE0OC4zMDYgMjMzLjkxNSAxMzYuOTYiIHN0cm9rZT0iIzAwMDAwMCIgc3Ryb2tlLW9wYWNpdHk9IjAuOSIgc3Ryb2tlLXdpZHRoPSIyMCIgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIiBzdHJva2UtbGluZWpvaW49InJvdW5kIi8+DQo8cGF0aCBkPSJNMTQwIDI0Mi41MTFDMTgxLjc3MiAyNzMuOTgxIDIyNS45NTYgMjcyLjY0IDI2MC43MzUgMjMyLjE4OCIgc3Ryb2tlPSIjMDAwMDAwIiBzdHJva2Utb3BhY2l0eT0iMC45IiBzdHJva2Utd2lkdGg9IjIwIiBzdHJva2UtbGluZWNhcD0icm91bmQiIHN0cm9rZS1saW5lam9pbj0icm91bmQiLz4NCjwvc3ZnPg==",
"config": {
"colors": [
{"name": "sample_color1", "default": "#aabbcc", "label": "Color 1"},
{"name": "sample_color2", "default": "#112233", "label": "Color 2"}
],
"page_components": [
{"name": "header", "label": "Header", "type": "header"},
{"name": "footer", "label": "Footer", "type": "footer"},
{"name": "aside", "label": "Aside", "type": "other"}
],
"pages": [
{"name": "mainpage", "label": "Mainpage", "type": "mainpage"},
{"name": "section1", "label": "Section 1", "type": "section"},
{"name": "section2", "label": "Section 2", "type": "section"},
{"name": "series1", "label": "Series 1", "type": "series"},
{"name": "series2", "label": "Series 2", "type": "series"},
{"name": "author1", "label": "Author 1", "type": "author"},
{"name": "author2", "label": "Author 2", "type": "author"},
{"name": "article1", "label": "Article 1", "type": "article"},
{"name": "article2", "label": "Article 2", "type": "article"}
],
"relations": [
{"name": "element", "place_type": "number", "label": "is element of"},
{"name": "event", "place_type": "date", "label": "is event of"},
{"name": "event2", "place_type": "date", "label": "is event2 of"}
],
"strings": [
{"name": "timeline-label", "label": "Label: timeline", "default": "Timeline"}
]
},
"templates": [
{"template_uri": "header_css", "template_set":"header", "template_type": "page_component", "content_type": "css", "contents": ""},
{"template_uri": "header_html", "template_set":"header", "template_type": "page_component", "content_type": "html", "contents": ""},
{"template_uri": "footer_css", "template_set":"footer", "template_type": "page_component", "content_type": "css", "contents": ""},
{"template_uri": "footer_html", "template_set":"footer", "template_type": "page_component", "content_type": "html", "contents": ""},
{"template_uri": "aside_css", "template_set":"aside", "template_type": "page_component", "content_type": "css", "contents": ""},
{"template_uri": "aside_html", "template_set":"aside", "template_type": "page_component", "content_type": "html", "contents": ""},
{"template_uri": "mainpage_css", "template_set":"mainpage", "template_type": "mainpage", "content_type": "css", "contents": ""},
{"template_uri": "mainpage_html", "template_set":"mainpage", "template_type": "mainpage", "content_type": "html", "contents": ""},
{"template_uri": "section1_css", "template_set":"section1", "template_type": "section", "content_type": "css", "contents": ""},
{"template_uri": "section1_html", "template_set":"section1", "template_type": "section", "content_type": "html", "contents": ""},
{"template_uri": "section2_css", "template_set":"section2", "template_type": "section", "content_type": "css", "contents": ""},
{"template_uri": "section2_html", "template_set":"section2", "template_type": "section", "content_type": "html", "contents": ""},
{"template_uri": "series1_css", "template_set":"series1", "template_type": "series", "content_type": "css", "contents": ""},
{"template_uri": "series1_html", "template_set":"series1", "template_type": "series", "content_type": "html", "contents": ""},
{"template_uri": "series2_css", "template_set":"series2", "template_type": "series", "content_type": "css", "contents": ""},
{"template_uri": "series2_html", "template_set":"series2", "template_type": "series", "content_type": "html", "contents": ""},
{"template_uri": "author1_css", "template_set":"author1", "template_type": "author", "content_type": "css", "contents": ""},
{"template_uri": "author1_html", "template_set":"author1", "template_type": "author", "content_type": "html", "contents": ""},
{"template_uri": "author2_css", "template_set":"author2", "template_type": "author", "content_type": "css", "contents": ""},
{"template_uri": "author2_html", "template_set":"author2", "template_type": "author", "content_type": "html", "contents": ""},
{"template_uri": "article1_css", "template_set":"article1", "template_type": "article", "content_type": "css", "contents": ""},
{"template_uri": "article1_html", "template_set":"article1", "template_type": "article", "content_type": "html", "contents": ""},
{"template_uri": "article2_css", "template_set":"article2", "template_type": "article", "content_type": "css", "contents": ""},
{"template_uri": "article2_html", "template_set":"article2", "template_type": "article", "content_type": "html", "contents": ""}
]
}
Tip: create a theme with blank templates, import them in the Appearance section, and edit them in the Templates section.
Notes:
- Don't repeat a name already used for a page or page_component.
- There should be two templates for each page and page_component: an _html and a _css.