PHPackages                             tryhackx/flarum-advanced-pages - 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. [Parsing &amp; Serialization](/categories/parsing)
4. /
5. tryhackx/flarum-advanced-pages

ActiveFlarum-extension[Parsing &amp; Serialization](/categories/parsing)

tryhackx/flarum-advanced-pages
==============================

Create advanced custom pages with HTML, BBCode, Markdown, PHP, or plain text content types for Flarum 2.x.

2.0.3(1mo ago)185MITJavaScriptPHP ^8.1

Since Apr 12Pushed 1mo agoCompare

[ Source](https://github.com/TryHackX/flarum-advanced-pages)[ Packagist](https://packagist.org/packages/tryhackx/flarum-advanced-pages)[ RSS](/packages/tryhackx-flarum-advanced-pages/feed)WikiDiscussions main Synced today

READMEChangelogDependencies (2)Versions (7)Used By (0)

Advanced Pages for Flarum
=========================

[](#advanced-pages-for-flarum)

[![Flarum 2.x](https://camo.githubusercontent.com/c685ab9c582b67982fccb9534f2b35cd8de7ee1a6ae2540336c763ce9d4c0e83/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f466c6172756d2d322e782d6f72616e6765)](https://flarum.org)[![Packagist](https://camo.githubusercontent.com/e3c969ccfeae744f7d573527ee45395fcc29ae5b015f689b90c74e4e997e3fdb/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f7472796861636b782f666c6172756d2d616476616e6365642d7061676573)](https://packagist.org/packages/tryhackx/flarum-advanced-pages)[![License: MIT](https://camo.githubusercontent.com/08cef40a9105b6526ca22088bc514fbfdbc9aac1ddbf8d4e6c750e3a88a44dca/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f4c6963656e73652d4d49542d626c75652e737667)](LICENSE)

Create advanced custom pages with **HTML**, **BBCode**, **Markdown**, **PHP**, or **plain text** content types for your Flarum 2.x forum. A powerful alternative to fof/pages with multi-format support, live preview, formatting toolbars, and granular access control.

Features
--------

[](#features)

- **5 content types** - HTML (HTMLPurifier sanitized), BBCode, Markdown, PHP (sandboxed), Plain Text
- **Formatting toolbars** - Context-aware buttons for BBCode and Markdown editors
- **Live preview** - Raw/Preview toggle with syntax highlighting (highlight.js One Dark)
- **Code editor** - CodeMirror-powered editor for HTML and PHP with syntax highlighting
- **BBCode extensions** - `[table]`, `[spoiler]`, `[center]`, extended `[url]` parser (configurable)
- **Newline modes** - Flarum vanilla or preserve-all for BBCode pages
- **Spoiler system** - `[spoiler]` / `[spoiler=Title]` with permission-based visibility
- **Admin panel** - Full CRUD with pagination, per-page selector, and inline settings
- **SEO support** - Meta descriptions and proper `` tags
- **Access control** - Publish, hide (admin-only), restrict (login required), per-group visibility
- **Custom permissions** - Manage pages, view spoiler content
- **Clean URLs** - Pages accessible at `/p/{slug}`

Screenshots
-----------

[](#screenshots)

[![Admin panel with page management, BBCode editor with toolbar, and live preview](assets/preview.gif)](assets/preview.gif)

*Admin panel with page management, BBCode editor with toolbar, and live preview.*

Support Development
-------------------

[](#support-development)

If you find this extension useful, consider supporting its development:

- **Monero (XMR):** `45hvee4Jv7qeAm6SrBzXb9YVjb8DkHtFtFh7qkDMxS9zYX3NRi1dV27MtSdVC5X8T1YVoiG8XFiJkh4p9UncqWGxHi4tiwk`
- **Bitcoin (BTC):** `bc1qncavcek4kknpvykedxas8kxash9kdng990qed2`
- **Ethereum (ETH):** `0xa3d38d5Cf202598dd782C611e9F43f342C967cF5`

You can also find the donation option in the extension's admin settings panel.

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

[](#requirements)

- **Flarum** `^2.0`
- **PHP** `^8.1`
- **PHP memory\_limit** `256M` minimum (512M+ recommended)

Installation
------------

[](#installation)

```
composer require tryhackx/flarum-advanced-pages:"*"
php flarum migrate
php flarum cache:clear
```

Updating
--------

[](#updating)

```
composer update tryhackx/flarum-advanced-pages
php flarum migrate
php flarum cache:clear
```

Usage
-----

[](#usage)

### Creating Pages

[](#creating-pages)

1. Go to **Admin Panel** &gt; **Advanced Pages**
2. Click **Create Page**
3. Choose a content type and write your content
4. Configure visibility (published, hidden, restricted, group access)
5. Save — page is available at `/p/{your-slug}`

### Content Types

[](#content-types)

TypeDescriptionSecurity**HTML**Full HTML with styles, scripts, formsRaw output, permission-gated**BBCode**BBCode with custom tags &amp; toolbarEscaped and parsed via s9e/TextFormatter**Markdown**Full Markdown with live previewEscaped and parsed via s9e/TextFormatter**PHP**Server-side PHP executionAdmin-only, sandboxed, errors logged never shown**Plain Text**Auto-escaped text with URL linkingFully escaped output### BBCode Settings

[](#bbcode-settings)

Toggle custom BBCode tags in the admin settings:

SettingTagsDefaultTables`[table]` `[tr]` `[th]` `[td]`EnabledSpoiler`[spoiler]` `[spoiler=Title]`EnabledCenter`[center]`EnabledExtended URL`[url]` (accepts URLs rejected by Flarum)DisabledChanges to BBCode settings require clearing the formatter cache:

```
php flarum cache:clear
```

### Newline Mode (BBCode)

[](#newline-mode-bbcode)

Each BBCode page has a configurable newline mode:

- **Flarum** (default) - Multiple newlines collapse to a single break (vanilla Flarum behavior)
- **Preserve** - All newlines are respected as `` tags

### PHP Pages

[](#php-pages)

PHP pages execute in a sandboxed environment with access to:

- `$page` - The current Page model
- `$actor` - The current user (or `null` for guests)
- `$settings` - Flarum SettingsRepository

```
Welcome,
