PHPackages                             oui/oui\_flat - 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. [Templating &amp; Views](/categories/templating)
4. /
5. oui/oui\_flat

ActiveTextpattern-plugin[Templating &amp; Views](/categories/templating)

oui/oui\_flat
=============

Textpattern CMS templates as flat files (rah\_flat fork)

0.6.0(9y ago)7333GPL-2.0PHPPHP &gt;=5.2.0

Since Aug 30Pushed 8y ago3 watchersCompare

[ Source](https://github.com/NicolasGraph/oui_flat)[ Packagist](https://packagist.org/packages/oui/oui_flat)[ Docs](https://github.com/nicolasgraph/oui_flat)[ RSS](/packages/oui-oui-flat/feed)WikiDiscussions master Synced 2d ago

READMEChangelog (3)Dependencies (3)Versions (5)Used By (0)

oui\_flat
=========

[](#oui_flat)

[Download](https://github.com/nicolasgraph/oui_flat/releases) | [Packagist](https://packagist.org/packages/oui/oui_flat) | [Donate to the original author](http://rahforum.biz/donate/oui_flat)

This plugin makes your [Textpattern CMS](http://www.textpattern.com) database more flat, manageable and editable. Edit templates, forms, pages, preferences and sections as flat files. Use any editor, work in teams and store your website’s source under your favorite [version control system](http://en.wikipedia.org/wiki/Revision_control).

**Warning: this plugin will permanently remove some of your current templates when activated.**

Installing
----------

[](#installing)

Using [Composer](https://getcomposer.org):

```
$ composer require oui/oui_flat:*
```

Or [download](https://github.com/nicolasgraph/oui_flat/releases) a plugin package.

Requirements
------------

[](#requirements)

- Textpattern 4.6.0 or newer.
- PHP 5.3.6 or newer.

Basics
------

[](#basics)

oui\_flat imports normal, flat files from a specified directory to your Textpattern database. This, in essence, lets you to edit your database contents from any regular editor and store the source as flat files.

oui\_flat comes with built-in support for a few essential content types: styles, forms, pages, preferences, sections and textpacks. It is also able to manage variables via plugin prefs. See the [templates](https://github.com/nicolasgraph/oui_flat/tree/master/templates) directory on GitHub for an example how this all works.

Your flat files are imported to the database:

- Automatically on the background when the site is in the production status selected via the related plugin preference.
- When the public callback hook URL is accessed. The URL can be used for deployment.

If you want to exclude a certain content type from importing, just don’t create a directory for it. No directory, and oui\_flat will leave the database alone when it comes to that content type.

Preferences
-----------

[](#preferences)

The plugin has set of preferences you can find on Textpattern’s normal preferences panel.

### Path to the templates directory

[](#path-to-the-templates-directory)

Specifies path to the root templates directory containing all the content-type specific directories. This path is relative to your ‘textpattern’ installation directory. For example, a path `../templates` would point to a directory located in the same directory as your *textpattern* directory and the main *index.php* file.

### Security key for the public callback

[](#security-key-for-the-public-callback)

Security key for the public callback hook URL. Importing is done when the URL is accessed. The URL follows the format of:

```
http://example.com/?oui_flat_key={yourKey}
```

Where `http://example.com/` is your site’s URL, and `{yourKey}` is the security key you specified.

Templates folder example
------------------------

[](#templates-folder-example)

```
┌ templates
├── forms
├── pages
├── prefs
├── sections
├── styles
├── textpacks
└── variables
```

For most existing template subfolders, the related admin tab will be disable.
The *Admin &gt; Preferences* tab will still be accessible, however saved preferences will be overriden by existing flat files while the `/prefs` folder exists
The admin *Admin &gt; languages* tab will still be accessible and usable while the `/pages` folder exists.

Contained files can use whatever extension.

### Forms

[](#forms)

Form types can be defined by filename prefixes or `/forms` subfolder names.
`misc` type is used by default when no prefix is found in files stored directly in the `/form` folder.

```
┌ templates
├── forms
├──── article.example_1.txp
├──── example_2.txp
├──── …
├── …
```

or

```
┌ templates
├── forms
├──── article
├────── example_1.txp
├────── …
├──── misc
├────── example_2.txp
├────── …
├──── …
├── …
```

### Pages

[](#pages)

```
├── …
├── pages
├──── example.txp
├──── …
├── …
```

### Prefs

[](#prefs)

Prefs files can contain a JSON tree or just the preference value as text.

```
├── …
├── prefs
├──── sitename.json
├──── site_slogan.txt
├──── …
├── …
```

Available JSON field is:

- `val` (string): preference value;

`sitename.txt` would just contain the preference related value.

### Sections

[](#sections)

Sections files are managed via JSON files.

```
├── …
├── sections
├──── example.json
├──── …
├── …
```

Available JSON fields are:

- `title` (string): section title;
- `description` (string): section meta-description;
- `page` (string): page in use;
- `css` (string): styles in use;
- `is_default` (bool): `true` makes it the default section;
- `in_rss` (bool): `true` includes section articles in feeds;
- `on_frontpage` (bool): `true` displays section articles on the frontpage;
- `searchable` (bool): `true` includes section articles in search results.

### Styles

[](#styles)

```
├── …
├── styles
├──── default.css
├──── …
├── …
```

### textpacks

[](#textpacks)

```
├── …
├── textpacks
├──── example.textpack
├──── …
├── …
```

### Variables

[](#variables)

Variables can be defined via JSON files as plugin prefs and used through the `` tag.

```
├── …
├── variables
├──── example.json
├──── …
```

Available JSON fields are:

- `value` (string): variable value;
- `html` (string): name of the function to use in the admin (if the `/variables` is removed). Natively available functions are: `text_input`, `pref_long_text`, `yesnoradio`.
- `position` (int): variable position.

Toolshed notice
---------------

[](#toolshed-notice)

This is a toolshed project. Experimental fork from [rah\_flat](https://github.com/gocom/rah_flat) which is not part of the main supported product line of [Rah](https://github.com/gocom). Not yet at least. Please use at your own risk.

Changelog
---------

[](#changelog)

### Version 0.7.0-beta (oui\_flat from upcoming rah\_flat-v0.4) – 2017/06/25

[](#version-070-beta-oui_flat-from-upcoming-rah_flat-v04--20170625)

- Changed: requires Textpatern 4.6+
- Added: Do not delete pages or styles that are used by a section.
- Changed: variables use `rah_flat_variables` event only and are all visible or hidden as for other contents;
- Changed: preferences stay always visible.
- Improved: Uses original Textpacks format;

### Version 0.6.0 (oui\_flat) – 2017/03/14

[](#version-060-oui_flat--20170314)

- Changed: Back to `oui_` plugin author prefix.
- Changed: Lighten compiled code by removing duplicated license infos.

### Version 0.5.0 (oui\_flat) – 2016/08/26

[](#version-050-oui_flat--20160826)

- Changed: Forms are stored by types in subfolders and don’t need prefixes anymore.
- Added: Custom form types are changed to ‘misc’ when the plugin is disable to avoid an error in the Forms tab.
- Changed: Preferences update affects values only.
- Added: Prefs are hidden in the admin if set via flat files and get back to visible when the plugin is disabled.
- Added: Custom prefs (in the variables folder) accept more paramters in .json files.
- Changed: Custom prefs (in the variables folder) now have a oui\_flat\_var\_ prefix added to their name.

### Version 0.4.0 (oui\_flat) – 2015/11/29

[](#version-040-oui_flat--20151129)

- Added: Custom preferences can be created and use as Txp variables.
- Changed: Forms naming convention is now `type.name.txp`.

### Version 0.3.0 (rah\_flat) – 2014/03/28

[](#version-030-rah_flat--20140328)

- Added: Drop access to a admin-side panel only if the specific content-type is active and has a directory set up.
- Added: Invokable `oui_flat.import` callback event.
- Added: Sections and preferences get their names from the filename.
- Added: Preferences are always just updated, no strands are created.
- Added: Preference fields that are not specified in a file are kept as-is in the database.
- Added: French translation by [Patrick Lefevre](https://github.com/cara-tm).
- Changed: Renamed confusing `Oui_Flat_Import_Template` interface to `Oui_Flat_Import_ImportInterface`.

### Version 0.2.0 (rah\_flat) – 2014/03/19

[](#version-020-rah_flat--20140319)

- Reworked.

### Version 0.1.0 (rah\_flat) – 2013/05/07

[](#version-010-rah_flat--20130507)

- Initial release.

###  Health Score

26

—

LowBetter than 43% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity15

Limited adoption so far

Community10

Small or concentrated contributor base

Maturity51

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% 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 ~150 days

Total

3

Last Release

3244d ago

PHP version history (2 changes)v0.5.0PHP &gt;=5.2.0

0.7.0-beta2PHP &gt;=5.3.6

### Community

Maintainers

![](https://www.gravatar.com/avatar/08870ec5c5f7d2d86060a2af7213ee86577215c40909b7cdbfd748be616bced2?d=identicon)[oui](/maintainers/oui)

---

Top Contributors

[![philwareham](https://avatars.githubusercontent.com/u/413665?v=4)](https://github.com/philwareham "philwareham (2 commits)")

---

Tags

flat-filestemplatestextpatterntextpattern-pluginthemethemesplugintemplateflattextpattern

###  Code Quality

Code StylePHP\_CodeSniffer

### Embed Badge

![Health badge](/badges/oui-oui-flat/health.svg)

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

PHPackages © 2026

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