Skip to content

Commit 06ccb7e

Browse files
committed
Documentation improvements
1 parent 454472a commit 06ccb7e

File tree

5 files changed

+127
-55
lines changed

5 files changed

+127
-55
lines changed

README.md

Lines changed: 122 additions & 51 deletions
Original file line numberDiff line numberDiff line change
@@ -5,31 +5,24 @@
55
[![GitHub Code Style Action Status](https://img.shields.io/github/actions/workflow/status/statikbe/laravel-filament-flexible-content-block-pages/fix-php-code-style-issues.yml?branch=main&label=code%20style&style=flat-square)](https://github.com/statikbe/laravel-filament-flexible-content-block-pages/actions?query=workflow%3A"Fix+PHP+code+style+issues"+branch%3Amain)
66
[![Total Downloads](https://img.shields.io/packagist/dt/statikbe/laravel-filament-flexible-content-block-pages.svg?style=flat-square)](https://packagist.org/packages/statikbe/laravel-filament-flexible-content-block-pages)
77

8-
A CMS solution for Laravel applications built on [Filament Flexible Content Blocks](https://github.com/statikbe/laravel-filament-flexible-content-blocks).
9-
This package extends the flexible content block system, into a full page management solution with routing, SEO, menus, and multilingual support.
8+
Filament Flexible Content Block Pages is a CMS solution for Laravel applications built on [Filament Flexible Content Blocks](https://github.com/statikbe/laravel-filament-flexible-content-blocks).
9+
This package extends the flexible content block system, into a full page management solution with routing, SEO, menus, tags and multilingual support.
1010

11-
Designed for developers who need a content management system that integrates seamlessly with existing Laravel Filament application,
11+
Designed for developers who need a content management system that provides a lot of flexibility to fit requirements,
1212
while providing content editors with an intuitive interface for managing pages and content.
1313

1414
## Key Features
1515

16-
- **Flexible page management** - Create pages with hero images, flexible content blocks, SEO fields, and publication controls
17-
- **Hierarchical menu builder** - Drag-and-drop interface for creating navigation menus
18-
- **Multilingual support** - Full localization with automatic route generation for multiple languages
19-
- **SEO tools** - Automatic sitemap generation, meta tag management, SEO tag pages, and URL redirect handling when slugs change
20-
- **Ready-to-use admin interface** - Pre-configured Filament panel with all resources and management tools
21-
- **Developer-friendly** - Extendable models & tables, customizable templates, and comprehensive configuration options
22-
- **Content organization** - Tag system, hierarchical page structure, and settings management
23-
- **Works out-of-the-box** - Get the package quickly up and running, while focussing on easy configuration, customisation & extendability.
16+
- **📄 Flexible page management** - Create pages with hero images, flexible content blocks, SEO fields, and publication controls
17+
- **🍔 Hierarchical menu builder** - Drag-and-drop interface for creating navigation menus
18+
- **🌍 Multilingual support** - Full localization with automatic route generation for multiple languages
19+
- **🔍 SEO tools** - Automatic sitemap generation, meta tag management, SEO tag pages, and URL redirect handling when slugs change
20+
- **Ready-to-use admin interface** - Pre-configured Filament panel with all resources and management tools
21+
- **🛠️ Developer-friendly** - Extendable models & tables, customizable templates, and comprehensive configuration options
22+
- **🏷️ Content organization** - Tag system, hierarchical page structure, and settings management
23+
- **🚀 Works out-of-the-box** - Get the package quickly up and running, while focussing on easy configuration, customisation & extendability.
2424

25-
## Additional Features
26-
27-
- Website routing with customizable URL patterns
28-
- Blade view components and CSS themes
29-
- Media library integration via Spatie packages
30-
- Automatic 301 redirects when page URLs change
31-
- Multiple sitemap generation methods (manual, crawling, hybrid)
32-
- Configurable content blocks and layouts
25+
This package makes use of [several great open-source packages](#used-packages) to be able to bundle these features.
3326

3427
## Table of contents
3528

@@ -42,6 +35,7 @@ while providing content editors with an intuitive interface for managing pages a
4235
* [Translations](#translations)
4336
* [Routes](#routes)
4437
* [Filament panel](#filament-panel)
38+
* [Redirects](#redirects)
4539
* [Schedule](#schedule)
4640
* [Page management](#page-management)
4741
* [Features](#features)
@@ -62,26 +56,31 @@ while providing content editors with an intuitive interface for managing pages a
6256
* [Route Registration](#route-registration)
6357
* [Generating URLs](#generating-urls)
6458
* [Route Helpers](#route-helpers)
65-
* [Redirects](#redirects)
66-
* [Configuration](#configuration)
59+
* [Redirects](#redirects-1)
60+
* [Redirect middleware configuration](#redirect-middleware-configuration)
6761
* [Sitemap Generator](#sitemap-generator)
6862
* [Features](#features-2)
6963
* [Usage](#usage)
7064
* [Automatic Generation](#automatic-generation)
7165
* [Tags and SEO Tag Pages](#tags-and-seo-tag-pages)
66+
* [Features](#features-3)
67+
* [Tag Management](#tag-management)
68+
* [Tag Types](#tag-types)
69+
* [SEO Tag Pages](#seo-tag-pages)
7270
* [Authorisation](#authorisation)
73-
* [Configuration](#configuration-1)
71+
* [Configuration](#configuration)
7472
* [TODO's](#todos)
7573
* [Future work](#future-work)
7674
* [Development](#development)
7775
* [Changelog](#changelog)
7876
* [Contributing](#contributing)
7977
* [Security Vulnerabilities](#security-vulnerabilities)
8078
* [Credits](#credits)
79+
* [Used packages](#used-packages)
8180
* [License](#license)
8281

8382
<!-- Created by https://github.com/ekalinin/github-markdown-toc -->
84-
<!-- Added by: sten, at: Tue Sep 9 23:28:54 CEST 2025 -->
83+
<!-- Added by: sten, at: Thu Sep 11 00:02:19 CEST 2025 -->
8584

8685
<!--te-->
8786

@@ -136,7 +135,7 @@ You can now seed the home page and default settings by running:
136135
php artisan flexible-content-block-pages:seed
137136
```
138137

139-
Further configure the [third-party packages that are used](#credits). Check the installation documentation of the following packages:
138+
Further configure the [third-party packages that are used](#used-packages). Check the installation documentation of the following packages:
140139

141140
### Laravel Filament Flexible Content Blocks
142141

@@ -173,7 +172,7 @@ php artisan vendor:publish --tag="filament-flexible-content-block-pages-views"
173172

174173
If you want translated content and routes, go through the following steps:
175174

176-
1. Configure the `supported_locales` in the Filament Flexible Content Blocks configuration or in a service provider
175+
1. Configure the `supported_locales` in [the Filament Flexible Content Blocks configuration or in a service provider](https://github.com/statikbe/laravel-filament-flexible-content-blocks/blob/main/documentation/configuration.md#supported-locales)
177176
2. Configure the `route_helper` in [`filament-flexible-content-block-pages.php`](./config/filament-flexible-content-block-pages.php)
178177

179178
### Routes
@@ -199,6 +198,10 @@ The package contains a pre-configured panel. You can register the panel in the `
199198

200199
If you want you can build your own panel from the provided resources.
201200

201+
### Redirects
202+
203+
Add the redirect middleware, see [Redirect configuration](#redirect-middleware-configuration)
204+
202205
### Schedule
203206

204207
We suggest to add media library maintenance tasks to your schedule in `routes/console.php`:
@@ -261,7 +264,8 @@ In case you need deeper nesting, you can add extra routes.
261264

262265
### Publication Controls
263266

264-
Control page visibility with by setting publishing begin and end dates. So you can achieve the following statuses:
267+
Control page visibility with by setting publishing begin and end dates.
268+
So you can achieve the following statuses by setting these dates in the past or future:
265269

266270
- **Draft** - Page exists but not visible to public users
267271
- **Published** - Page is live and accessible via URL
@@ -289,21 +293,6 @@ For customisation, publish the views and if needed extend the [LanguageSwitch co
289293

290294
### Frontend Integration
291295

292-
Generate URLs for pages in your Blade templates:
293-
294-
```php
295-
use Statikbe\FilamentFlexibleContentBlockPages\Facades\FilamentFlexibleContentBlockPages;
296-
297-
// Generate page URL
298-
$url = FilamentFlexibleContentBlockPages::getUrl($page);
299-
300-
// Generate URL for specific locale
301-
$url = FilamentFlexibleContentBlockPages::getUrl($page, 'en');
302-
303-
// OR there is a shorthand helper:
304-
flexiblePageUrl($page, 'nl');
305-
```
306-
307296
You can best publish the views and customise the styling and HTML structure to your project requirements.
308297

309298
For detailed frontend templating, theme customization, and available Blade components, see the [frontend documentation](documentation/frontend.md).
@@ -312,7 +301,8 @@ For advanced page customization, extending models, and custom workflows, see the
312301

313302
## Menu builder
314303

315-
The package includes a powerful hierarchical menu builder with a drag-and-drop interface for creating navigation menus. Menus support multiple types of links and can be easily styled with custom templates.
304+
The package includes a powerful hierarchical menu builder with a drag-and-drop interface, using [solution-forest/filament-tree](https://github.com/solutionforest/filament-tree).
305+
Menus support multiple types of links and can be easily styled with custom templates.
316306

317307
### Features
318308

@@ -326,7 +316,8 @@ The package includes a powerful hierarchical menu builder with a drag-and-drop i
326316

327317
### Adding a menu to Blade
328318

329-
The package includes a `default` built-in menu style which is developed in a generic way so that you can tweak its styling by passing some attributes without having to publish the corresponding blade templates.
319+
The package includes a `default` built-in menu style which is developed in a generic way so that you can tweak its styling,
320+
by passing some attributes without having to publish the corresponding blade templates.
330321

331322
Example usage to have a horizontal menu using tailwind:
332323
```blade
@@ -373,7 +364,7 @@ class Product extends Model implements HasMenuLabel
373364
}
374365
```
375366

376-
If you are using the Flexible Content Blocks title trait in your model, you can implement `HasMenuLabel`
367+
**Tip:** If you are using the Flexible Content Blocks title trait in your model, you can implement `HasMenuLabel`
377368
easily with [`HasTitleMenuLabelTrait`](src/Models/Concerns/HasTitleMenuLabelTrait.php).
378369

379370
### Menu seeding
@@ -385,7 +376,12 @@ For creating custom menu styles and advanced menu customization, see the [menu c
385376

386377
## Settings
387378

388-
All settings are stored in one table in one record. The reason is to be able to add spatie medialibrary media as a config value.
379+
All settings are stored in one table in one record.
380+
The reason is to be able to add spatie medialibrary media as a config value.
381+
By using one record and a new media collection for each media setting, you can more easily add media.
382+
Furthermore, by manually adding a specific column for a setting, the data types are also correct and castable.
383+
In contrast, if we would use a key-value or JSON-based solution, not all our requirements could be served.
384+
389385
Each setting is cached and refreshed when the settings change.
390386

391387
### Use settings
@@ -440,11 +436,14 @@ $url = FilamentFlexibleContentBlockPages::getUrl($page);
440436

441437
// Generate URL for a specific locale
442438
$url = FilamentFlexibleContentBlockPages::getUrl($page, 'en');
439+
440+
// OR there is a shorthand helper:
441+
flexiblePageUrl($page, 'nl');
443442
```
444443

445444
In Blade templates:
446445
```blade
447-
<a href="{{ \Statikbe\FilamentFlexibleContentBlockPages\Facades\FilamentFlexibleContentBlockPages::getUrl($page) }}">
446+
<a href="{{ flexiblePageUrl($page) }}">
448447
{{ $page->title }}
449448
</a>
450449
```
@@ -463,12 +462,12 @@ For advanced routing customization, custom route helpers, and controller extensi
463462
## Redirects
464463

465464
The package includes automatic redirect management: when the slug of a page changes, a redirect from the old page
466-
to the new page is added. These redirects are stored in the database and are managable with the Filament resource,
467-
so you can add your own redirects. For example, you can add handy redirects for marketing campaigns.
465+
to the new page is added. These redirects are stored in the database and are manageable with the Filament resource,
466+
so you can add your own redirects. For example, you can add handy redirects for marketing campaigns or quick links.
468467

469468
We have integrated [spatie/laravel-missing-page-redirector](https://github.com/spatie/laravel-missing-page-redirector), so you can easily configure other redirects in the spatie packages config.
470469

471-
### Configuration
470+
### Redirect middleware configuration
472471

473472
1. Prepend/append the [RedirectsMissingPages.php](src/Http/Middleware/RedirectsMissingPages.php) middleware to your global middleware stack:
474473

@@ -526,7 +525,77 @@ see the [sitemap customisation documentation](documentation/extending-and-custom
526525

527526
## Tags and SEO Tag Pages
528527

529-
TODO
528+
The package provides a comprehensive tagging system with SEO-optimized tag pages for content organization and search engine visibility.
529+
We make use of [Laravel Tags](https://github.com/spatie/laravel-tags) so all features of this spatie package are available.
530+
While spatie uses a string for tag type, we have implemented a TagType model with extra SEO and styling functionality.
531+
532+
### Features
533+
534+
- **Hierarchical tag system** - Tags organized by customizable tag types (categories, topics, etc.)
535+
- **Multilingual support** - Translatable tag names, slugs, and SEO descriptions
536+
- **SEO tag pages** - Automatically generated landing pages with all content of a tag for search engine optimization
537+
- **Visual organization** - Custom colors and icons for tag types
538+
- **Flexible routing** - Customizable URL patterns for tag pages (default: `/tag/{slug}`)
539+
540+
### Tag Management
541+
542+
Create and manage tags through the Filament admin interface:
543+
544+
- **Tag Types** - Define categories like "Topics", "Industries", or "Technologies"
545+
- **Tags** - Individual tags within each type with multilingual support
546+
- **SEO Settings** - Meta descriptions and tags can be enabled to have an SEO tag page
547+
- **Visual Identity** - Colors and icons for better organization
548+
549+
TODO screenshot
550+
551+
### Tag Types
552+
553+
Tag types provide structure and organization. You can add more specific tag types, e.g. for news articles only.
554+
555+
```php
556+
// Built-in tag types
557+
TagType::TYPE_DEFAULT = 'default'; // General purpose tags
558+
TagType::TYPE_SEO = 'seo'; // SEO-focused tags with landing pages
559+
```
560+
561+
**Key features:**
562+
- **Default type** - One tag type can be marked as default for new tags
563+
- **SEO pages** - Enable `has_seo_pages` to generate landing pages for tags of this type and an SEO description can be filled in that will be shown on the tag page for more context.
564+
- **Visual styling** - Custom colors and SVG icons for admin interface
565+
- **Translatable names** - Support for multiple languages
566+
567+
### SEO Tag Pages
568+
569+
When enabled (`has_seo_pages = true` on tag type), the package automatically generates SEO-optimized landing pages.
570+
The HTML of the tag pages is focused on the data structure for search engines and is not styled.
571+
If you also want to use this for other purposes, you can publish the views and style it.
572+
573+
**Content Inclusion:**
574+
SEO tag pages display content from models configured in [`tag_pages.models.enabled`](documentation/configuration.md#tag-pages-configuration):
575+
576+
```php
577+
// config/filament-flexible-content-block-pages.php
578+
'tag_pages' => [
579+
'models' => [
580+
'enabled' => [
581+
\Statikbe\FilamentFlexibleContentBlockPages\Models\Page::class,
582+
\App\Models\BlogPost::class, // Your custom models
583+
],
584+
],
585+
],
586+
```
587+
588+
**SEO Benefits:**
589+
- Automatic meta tags and descriptions
590+
- Multilingual hreflang tags
591+
- Content grouping by type or chronologically
592+
- Pagination for large content sets
593+
- Search engine friendly HTML structure
594+
- Tag pages are added to the sitemap
595+
596+
For advanced tag page customization, extending models, custom controllers, and template customization, see the [SEO tag pages documentation](documentation/extending-and-customisation.md#seo-tag-pages).
597+
598+
For tag configuration options, URL patterns, and content inclusion settings, see the [configuration documentation](documentation/configuration.md#tags-configuration).
530599

531600
## Authorisation
532601

@@ -559,7 +628,6 @@ release:
559628
- policies:
560629
- note: undeletable pages
561630
- undeletable page toggle only for permission holder
562-
- documentation
563631
- Kristof: screenshots + banner + packagist + slack + filament plugin store
564632

565633
## Future work
@@ -597,6 +665,8 @@ Please review [our security policy](../../security/policy) on how to report secu
597665
- [Sten Govaerts](https://github.com/sten)
598666
- [All Contributors](../../contributors)
599667

668+
### Used packages
669+
600670
We built this on the shoulders of others by combining several Laravel packages into a cohesive CMS solution, making it opinionated.
601671
We would like to thank the developers and contributors of the following packages:
602672

@@ -606,6 +676,7 @@ We would like to thank the developers and contributors of the following packages
606676
- [solution-forest/filament-tree](https://github.com/solutionforest/filament-tree)
607677
- [spatie/laravel-missing-page-redirector](https://github.com/spatie/laravel-missing-page-redirector)
608678
- [spatie/laravel-sitemap](https://github.com/spatie/laravel-sitemap)
679+
- [spatie/laravel-tags](https://github.com/spatie/laravel-tags)
609680

610681
## License
611682

documentation/configuration.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ In this document, we explain all settings available in the [filament-flexible-co
3030
* [Custom Menu Styles](#custom-menu-styles)
3131

3232
<!-- Created by https://github.com/ekalinin/github-markdown-toc -->
33-
<!-- Added by: sten, at: Tue Sep 9 23:28:54 CEST 2025 -->
33+
<!-- Added by: sten, at: Thu Sep 11 00:02:19 CEST 2025 -->
3434

3535
<!--te-->
3636

documentation/extending-and-customisation.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ In this document, we will explain how you can change behaviour or extend functio
3131
* [Advanced Extensions](#advanced-extensions)
3232

3333
<!-- Created by https://github.com/ekalinin/github-markdown-toc -->
34-
<!-- Added by: sten, at: Tue Sep 9 23:28:55 CEST 2025 -->
34+
<!-- Added by: sten, at: Thu Sep 11 00:02:20 CEST 2025 -->
3535

3636
<!--te-->
3737

documentation/frontend.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ This document covers frontend templating, theme customization, and available Bla
2525
* [Accessibility](#accessibility)
2626

2727
<!-- Created by https://github.com/ekalinin/github-markdown-toc -->
28-
<!-- Added by: sten, at: Tue Sep 9 23:28:55 CEST 2025 -->
28+
<!-- Added by: sten, at: Thu Sep 11 00:02:20 CEST 2025 -->
2929

3030
<!--te-->
3131

documentation/seeders.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
# Menu Seeders
22

3-
This package provides a powerful and developer-friendly way to seed menus and menu items through the `MenuSeeder` abstract class. This base class offers typed methods with sensible defaults, making it easy to create complex menu structures programmatically.
3+
This package provides a powerful and developer-friendly way to seed menus and menu items through the `MenuSeeder` abstract class.
4+
This base class offers typed methods with sensible defaults, making it easy to create complex menu structures programmatically.
45

56
## Getting Started
67

0 commit comments

Comments
 (0)