User Docs Developer Docs | |

Getting Started with Theme Development

Build a minimum viable Pubvana theme with three files. You can activate it immediately and then fill in the remaining required templates.

Step 1: Create the Theme Directory

mkdir themes/mytheme
mkdir themes/mytheme/views
mkdir themes/mytheme/assets

Step 2: Create theme_info.json

{
    "name": "My Theme",
"version": "1.0.0",
    "min_pubvana_version": "2.2.3",
    "widget_areas": { "sidebar": "Main Sidebar" },
    "options": { "show_sidebar": { "type": "checkbox", "label": "Show Sidebar", "default": "1" } },
    "css_class_mapping": { "cls_container": "container", "cls_btn_primary": "btn btn-primary" }
}

Step 3: Create views/layout.tpl

<!DOCTYPE html>
<html lang="{{ locale }}">
<head>
    <meta charset="UTF-8">
    <title>{{ page_title }} — {{ site_name }}</title>
    <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/css/bootstrap.min.css">
    <link rel="stylesheet" href="{! theme_url "assets/css/style.css" !}">
</head>
<body>
    <div class="container my-4">
        <div class="row">
            <div class="col-lg-8">{% block content %}{% endblock %}</div>
            {% if theme_options.show_sidebar %}
            <div class="col-lg-4">{! widget_area "sidebar" !}</div>
            {% endif %}
        </div>
    </div>
</body>
</html>

Step 4: Create the Required Page Templates

Create home.tpl, post.tpl, page.tpl, category.tpl, tag.tpl, archive.tpl, and search.tpl in views/. Minimum content:

{% extends "layout.tpl" %}
{% block content %}
<h1>{{ page_title }}</h1>
{% endblock %}

Step 5: Activate

Go to Appearance → Themes, click Discover Themes, then Activate next to My Theme.

No PHP Allowed

The themes/ directory is enforced as PHP-free. Use {{ variable }}, {% %} control structures, and {! function !} helper calls. All data comes from controllers via template variables.