PHPackages                             tina4stack/tina4cms - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. tina4stack/tina4cms

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

tina4stack/tina4cms
===================

Tina4 CMS Module

v1.0.6(2mo ago)62.4k16[1 PRs](https://github.com/tina4stack/tina4-cms/pulls)MITJavaScriptPHP &gt;=8.1CI failing

Since Nov 18Pushed 2mo ago2 watchersCompare

[ Source](https://github.com/tina4stack/tina4-cms)[ Packagist](https://packagist.org/packages/tina4stack/tina4cms)[ RSS](/packages/tina4stack-tina4cms/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (10)Dependencies (18)Versions (58)Used By (0)

Tina4 CMS Module
================

[](#tina4-cms-module)

Welcome to the Tina4CMS module, how does it work?

```
composer require tina4stack/tina4cms

composer exec tina4 initialize:run

```

Sqlite is recommended for small to medium websites

```
composer require tina4stack/tina4php-sqlite3
```

Add the database connection to your index.php file which would have been created

```
require_once "vendor/autoload.php";

global $DBA;

$DBA = new \Tina4\DataSQLite3("test.db","", "", "d/m/Y");

echo new \Tina4\Tina4Php();

```

Run the CMS

```
composer start 8080

```

Open up the CMS to set up the admin user

 -&gt; will get you started

### The Landing Page - home

[](#the-landing-page---home)

You need to create a landing page called "home" as your starting page for things to working properly.

### Customization

[](#customization)

Make a *base.twig* file in your */src/templates* folder, it needs the following blocks

```

    {{ title }}

{% block headers %}

{% endblock %}

{% block body %}

{% block navigation %}
    {% include "navigation.twig" %}
{% endblock %}

{% block content %}
{% endblock %}

{% block footer %}
{% endblock %}

{% endblock %}

```

or an example which extends the existing base in the tina4-cms

```
{% extends "@tina4cms/base.twig" %}

{% block headers %}

{% endblock %}

{% block body %}

{% block navigation %}
    {%  include "navigation.twig" %}
{% endblock %}

{% block content %}
{% endblock %}

{% endblock %}

```

#### Example of a navigation.twig which you can over write

[](#example-of-a-navigationtwig-which-you-can-over-write)

Create a *navigation.twig* file in your *src/templates* folder

```
{% set menus = Content.getMenu("") %}

        {% for menu in menus %}
            {{ menu.name }}
                {% if menu.children %}

                        {% for childmenu in menu.children %}

                                {{ childmenu.name }}

                        {% endfor %}

                {% endif %}

        {% endfor %}

```

### Including your snippets in the CMS

[](#including-your-snippets-in-the-cms)

There are two ways you can do this:

When you want to include content as it is, and not have the snippet parsed with Twig you can simply use the following: Use the raw filter when you want to have scripts or other things included correctly

```
{{snippetName | raw}} or {{snippetName}}

```

The following is how you would include a snippet where you want variables in the page for example parsed in the snippet

```
{{ include(getSnippet("snippetName")) }}

```

#### Example:

[](#example)

Page content of "home"

```
  {% set world = "World!" %}

  {{ include (getSnippet("mySnippet")) }}

```

Snippet content of "mySnippet"

```
  Hello {{world}}!

```

Adding articles into a page

```
{% set articles = Content.getArticles ("", 8) %}
{% for article in articles %}{% include "snippets/medium.twig" with {"article": article} %}{% endfor %}
{% set params = {"tag": "all", "skip": 4, "limit": 4, "template": "medium.twig"} %}
{% include "load-more.twig" with params %}

```

Overwriting the default CMS twig namespace - your own namespace

```
CMS_TWIG_NAMESPACE=""

```

Page Builder
------------

[](#page-builder)

The page builder should implement GrapeJS and allow you to build pages using blocks and components. The blocks and components should be simple to load. We need to flag off pages that have been edited by the Page builder so the generic CMS does not try to render them.

Themes
------

[](#themes)

Use with care, this is currently experimental but will be introduced into the CMS at some point as a base for the pages Current thoughts are as follows:

### Theme Structure

[](#theme-structure)

```
src
    templates
        themes
            theme-name
                blocks
                    block-name-1.json
                    block-name-2.json
                components
                    component-name-1.json
                    component-name-2.json
                theme.twig

```

The default theme can be cloned to make other themes.

### Examples of extending the CMS Page Builder

[](#examples-of-extending-the-cms-page-builder)

In your index.php file where your config is initialized you can define the following.

```
$config = new \Tina4\Config(function(\Tina4\Config $config) {
    (new Content())->addCmsMenu("/backend/program", "Products"); //Menu example
    $config->addTwigGlobal("Menu", new Menu()); //Adding a twig global class
    (new Theme())->addTwigView("product", "Products", "examples/products.twig"); //Adding different snippets for use in CMS views
    (new Theme())->addTwigView("menu", "Menu", "examples/menu.twig");
}
```

---

Our Sponsors
------------

[](#our-sponsors)

**Sponsored with 🩵 by Code Infinity**

[![Code Infinity](https://camo.githubusercontent.com/1516fb1662e3486bce77822177a5ea199edc32ea109369812592ec9bca38159a/68747470733a2f2f636f6465696e66696e6974792e636f2e7a612f77702d636f6e74656e742f75706c6f6164732f323032352f30392f6338652d6c6f676f2d6769746875622e706e67)](https://codeinfinity.co.za/about-open-source-policy?utm_source=github&utm_medium=website&utm_campaign=opensource_campaign&utm_id=opensource)

*Supporting open source communities • Innovate • Code • Empower*

###  Health Score

55

—

FairBetter than 98% of packages

Maintenance87

Actively maintained with recent releases

Popularity26

Limited adoption so far

Community19

Small or concentrated contributor base

Maturity76

Established project with proven stability

 Bus Factor1

Top contributor holds 86.4% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~37 days

Recently: every ~182 days

Total

53

Last Release

62d ago

Major Versions

v0.0.45 → v1.0.0-alpha2023-12-26

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/82961293?v=4)[Tina4](/maintainers/tina4stack)[@tina4stack](https://github.com/tina4stack)

---

Top Contributors

[![andrevanzuydam](https://avatars.githubusercontent.com/u/6102941?v=4)](https://github.com/andrevanzuydam "andrevanzuydam (312 commits)")[![kobusvanwyk](https://avatars.githubusercontent.com/u/7395554?v=4)](https://github.com/kobusvanwyk "kobusvanwyk (26 commits)")[![zoevds](https://avatars.githubusercontent.com/u/102951302?v=4)](https://github.com/zoevds "zoevds (8 commits)")[![JonathanRabie001](https://avatars.githubusercontent.com/u/40660743?v=4)](https://github.com/JonathanRabie001 "JonathanRabie001 (4 commits)")[![CrisHigham](https://avatars.githubusercontent.com/u/62340127?v=4)](https://github.com/CrisHigham "CrisHigham (4 commits)")[![farmerstevieb](https://avatars.githubusercontent.com/u/38105759?v=4)](https://github.com/farmerstevieb "farmerstevieb (4 commits)")[![tina4stack](https://avatars.githubusercontent.com/u/82961293?v=4)](https://github.com/tina4stack "tina4stack (3 commits)")

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/tina4stack-tina4cms/health.svg)

```
[![Health](https://phpackages.com/badges/tina4stack-tina4cms/health.svg)](https://phpackages.com/packages/tina4stack-tina4cms)
```

###  Alternatives

[tbbc/composer-javascript

Composer script handler for executing `npm install` and `bower install` automatically.

1716.4k](/packages/tbbc-composer-javascript)[wildbit/craft3-donottrack

Craft 3 plugin for respecting Do Not Track headers sent by browsers.

144.3k](/packages/wildbit-craft3-donottrack)[cinghie/yii2-menu

Yii2 Menu to create, manage, and delete dynamic menus in a Yii2 site.

101.1k](/packages/cinghie-yii2-menu)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
