You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
A simple content page management system with a flexible content block builder based on the [Filament Flexible Content Blocks](https://github.com/statikbe/laravel-filament-flexible-content-blocks).
9
-
10
-
This package aims to provide a basic, batteries-included CMS for Filament by providing page creation in Filament and
11
-
renders web pages that can be easily extended and styled.
12
-
13
-
Other features that will be provided:
14
-
- Pages with hero, slugs, content blocks, publication options and SEO fields.
- Extendable settings model and Filament resource to store CMS settings and images.
18
-
- Redirect support for when slugs are renamed
19
-
- Sitemap generation
20
-
- A ready-to-use, extendable Filament panel with all CMS features implemented.
21
-
- Extendable models, resources and database tables.
22
-
- A simple asset manager (TODO)
23
-
- Re-usable content blocks (TODO)
24
-
- Contact form (TODO)
25
-
26
-
This package combines several existing packages and is therefore quite opinionated.
8
+
A complete CMS solution for Laravel applications built on [Filament Flexible Content Blocks](https://github.com/statikbe/laravel-filament-flexible-content-blocks). This package extends the flexible content block system into a full page management solution with routing, SEO, menus, and multilingual support.
9
+
10
+
Designed for developers who need a content management system that integrates seamlessly with existing Laravel applications while providing editors with an intuitive interface for managing pages and content.
11
+
12
+
## Key Features
13
+
14
+
-**Flexible page management** - Create pages with hero images, flexible content blocks, SEO fields, and publication controls
15
+
-**Hierarchical menu builder** - Configurable depth with drag-and-drop interface for creating navigation menus
16
+
-**Multilingual support** - Full localization with automatic route generation for multiple languages
17
+
-**SEO tools** - Automatic sitemap generation, meta tag management, and URL redirect handling
18
+
-**Ready-to-use admin interface** - Pre-configured Filament panel with all resources and management tools
19
+
-**Developer-friendly** - Extendable models, customizable templates, and comprehensive configuration options
20
+
-**Content organization** - Tag system, hierarchical page structure, and settings management
This package combines several Laravel packages into a cohesive CMS solution, making it opinionated but comprehensive for typical content management needs.
27
32
28
33
## Installation
29
34
@@ -79,7 +84,7 @@ Publish the config and change the tag model to the package model:
79
84
]
80
85
```
81
86
82
-
Check [the configuration documentation}(#configuration) for more explanations on how to tweak the package.
87
+
Check [the configuration documentation](#configuration) for more explanations on how to tweak the package.
83
88
84
89
Optionally, you can publish the views using
85
90
@@ -202,6 +207,150 @@ The style can also be configured in the database model, then you can skip the `s
202
207
203
208
See the [menu seeding documentation](documentation/seeders.md) for programmatic menu creation.
204
209
210
+
## Sitemap Generator
211
+
212
+
The package includes an automatic sitemap generator that creates XML sitemaps for your website with support for multilingual sites and various content types.
213
+
214
+
### Features
215
+
216
+
-**Multiple generation methods** - Manual, crawling, or hybrid approach
217
+
-**Multilingual support** - Automatic hreflang tags for alternate language versions
To include your own models in the sitemap, ensure they implement [the `Linkable` contract and have a `getViewUrl()` method](https://github.com/statikbe/laravel-filament-flexible-content-blocks#linkable).
287
+
288
+
You will most likely already have added those models to the menu configuration's `linkable_models` array or
289
+
[call-to-actions models](https://github.com/statikbe/laravel-filament-flexible-content-blocks#linkable) then they will automatically be included in the sitemap.
290
+
291
+
If you do not want your model in menus or call-to-actions, you can extend the [SitemapGeneratorService](src/Services/SitemapGeneratorService.php).
292
+
293
+
### Extending the SitemapGeneratorService
294
+
295
+
For full customization power, you can create your own sitemap generator service by extending the base class:
296
+
297
+
```php
298
+
<?php
299
+
300
+
namespace App\Services;
301
+
302
+
use Statikbe\FilamentFlexibleContentBlockPages\Services\SitemapGeneratorService;
303
+
304
+
class CustomSitemapGeneratorService extends SitemapGeneratorService
305
+
{
306
+
protected function addCustomUrls(): void
307
+
{
308
+
parent::addCustomUrls();
309
+
310
+
// Add your custom logic
311
+
$this->addToSitemap(
312
+
url: 'https://example.com/dynamic-page',
313
+
lastModifiedAt: now(),
314
+
priority: 0.7,
315
+
frequency: 'weekly'
316
+
);
317
+
}
318
+
319
+
protected function getLinkableModels(): array
320
+
{
321
+
$models = parent::getLinkableModels();
322
+
323
+
// Add additional models not in menu/CTA config
324
+
$models[] = \App\Models\BlogPost::class;
325
+
$models[] = \App\Models\Event::class;
326
+
327
+
return $models;
328
+
}
329
+
330
+
protected function calculatePriority($page): float
331
+
{
332
+
// Custom priority logic
333
+
if ($page->is_featured) {
334
+
return 0.9;
335
+
}
336
+
337
+
return parent::calculatePriority($page);
338
+
}
339
+
}
340
+
```
341
+
342
+
Then update your configuration to use your custom service:
You can override any protected method to customize the sitemap generation behavior, including priority calculation, change frequency, URL filtering, or adding entirely new content types.
353
+
205
354
## Configuration
206
355
207
356
TODO
@@ -213,10 +362,12 @@ TODO
213
362
- undeletable page toggle only for permission holder
214
363
- redirect controller
215
364
- tag controller
216
-
- sitemap implementation
217
-
- asset manager install in panel
218
365
- orm listeners for linkable models that are in a menu to avoid accidental deletion.
0 commit comments