Skip to content

Commit 70b06d5

Browse files
committed
update docs
1 parent 4f02859 commit 70b06d5

26 files changed

+805
-175
lines changed

docs/caching.md

Lines changed: 13 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -2,19 +2,21 @@
22
title: Caching
33
slug: caching
44
path: docs/v1/caching
5-
uri: /docs/1.x/caching
5+
uri: /docs/v1/caching
66
heading: Caching
7-
brief:
7+
brief:
8+
quick_links: []
89
---
910

11+
1012
## Overview
1113

1214
Caching in InspireCMS accelerates content delivery by storing frequently accessed data in fast-access storage. The system employs several caching strategies:
1315

14-
- **Language Cache**
15-
- **Navigation Cache**: Makes menu loading faster
16-
- **Route Cache**: Improves URL resolution
17-
- **KeyValue Cache**: Stores simple configuration and settings data
16+
- **Language Cache**
17+
- **Navigation Cache**: Makes menu loading faster
18+
- **Route Cache**: Improves URL resolution
19+
- **KeyValue Cache**: Stores simple configuration and settings data
1820

1921
---
2022

@@ -105,7 +107,6 @@ Clear the language cache manually:
105107
// Clear all language cache
106108
\SolutionForest\InspireCms\Facades\InspireCms::forgetCachedLanguages();
107109
```
108-
109110
---
110111

111112
## Navigation Caching
@@ -154,6 +155,7 @@ php artisan inspirecms:clear-cache --routes
154155

155156
InspireCMS provides a persistent key-value storage system with caching capabilities through the `KeyValue` model.
156157

158+
157159
### Working with KeyValue Model
158160

159161
The `KeyValue` model provides a simple way to store and retrieve configuration values:
@@ -212,7 +214,7 @@ php artisan inspirecms:clear-cache --navigation
212214

213215
InspireCMS automatically clears relevant caches when:
214216

215-
- Content is created, updated or deleted
216-
- Settings are changed
217-
- Templates are modified
218-
- Navigation is restructured
217+
- Content is created, updated or deleted
218+
- Settings are changed
219+
- Templates are modified
220+
- Navigation is restructured

docs/configuration.md

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,13 @@
1+
---
2+
title: Configuration
3+
slug: configuration
4+
path: docs/v1/configuration
5+
uri: /docs/v1/configuration
6+
heading: Configuration
7+
brief:
8+
quick_links: []
9+
---
10+
111
## Configuration Files
212

313
InspireCMS's configuration is primarily managed through the `config/inspirecms.php` file. If this file doesn't exist after installation, you can publish it using:
@@ -41,7 +51,7 @@ php artisan vendor:publish --tag="inspirecms-config"
4151

4252
### Authentication
4353

44-
Configure how users authenticate with your CMS \([learn more about laravel authentication](<(https://laravel.com/docs/12.x/authentication#adding-custom-guards)>)\):
54+
Configure how users authenticate with your CMS \([learn more about laravel authentication](https://laravel.com/docs/12.x/authentication#adding-custom-guards)\):
4555

4656
```php
4757
'auth' => [
@@ -492,7 +502,7 @@ Control how InspireCMS handles frontend requests:
492502
* Override to implement custom slug generation rules
493503
*/
494504
'slug_generator' => \SolutionForest\InspireCms\Content\DefaultSlugGenerator::class,
495-
505+
496506
'fallback_seo' => [
497507
'title' => env('APP_NAME', 'Home'),
498508
'description' => null,
@@ -556,4 +566,4 @@ Configure language and translation settings:
556566
// Format: language code or locale identifier
557567
'user_preferred_locales' => ['en','zh_CN','zh_TW'],
558568
],
559-
```
569+
```

docs/content-drafts-revisions.md

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,19 @@
22
title: Content Drafts & Revisions
33
slug: content-drafts-revisions
44
path: docs/v1/content-drafts-revisions
5-
uri: /docs/1.x/content-drafts-revisions
5+
uri: /docs/v1/content-drafts-revisions
66
heading: Content Drafts & Revisions
77
brief: InspireCMS provides a content versioning system that allows you to work with drafts and track revisions of your content. This guide explains how to use these features to manage your content workflow effectively.
8+
9+
quick_links: []
810
---
911

10-
## Content States Overview
12+
## Overview
1113

1214
In InspireCMS, content can exist in various states:
1315

16+
![Content](https://inspirecms.net/storage/doc/eYLJ6RJp8oYQQAgdXI7flQOGsktGGiMe4vmqvXDU.png)
17+
1418
1. **Draft**: Content that is being worked on but not yet published
1519
2. **Published**: Content that is live and visible to site visitors
1620
3. **Unpublished**: Previously published content that has been taken offline

docs/content-routing.md

Lines changed: 57 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,10 @@
22
title: Content Routing
33
slug: content-routing
44
path: docs/v1/content-routing
5-
uri: /docs/1.x/content-routing
5+
uri: /docs/v1/content-routing
66
heading: Content Routing
7-
brief:
7+
brief:
8+
quick_links: []
89
---
910

1011
## Overview
@@ -15,6 +16,18 @@ By default, content URLs follow a hierarchical structure:
1516
/parent-section/child-section/content-slug
1617
```
1718

19+
**Example Content Structure**:
20+
21+
```plaintext
22+
- Root
23+
- about
24+
- products
25+
- widgets
26+
- blue-widget
27+
- gadgets
28+
- red-gadget
29+
```
30+
1831
For example:
1932

2033
- `/about`: A top-level "About" page
@@ -49,6 +62,16 @@ Define constraints to validate parameters:
4962
]
5063
```
5164

65+
### Accessing Route Variables in Blade
66+
67+
After setting a content route with parameters, you can access those variables in your Blade templates. For example, if your route is defined as `/blog/{year}/{month}/{slug}`, you can access the `{year}` variable like this in your `blade.php` file:
68+
69+
```php
70+
<p>Year: {{ $year }}</p>
71+
```
72+
73+
This allows you to dynamically display content based on the URL parameters.
74+
5275
---
5376

5477
## Content Slugs
@@ -79,6 +102,38 @@ Slugs must:
79102
- Not conflict with existing routes or reserved words
80103
- Be unique within their parent section
81104

105+
### Customizing the Slug Generator
106+
You can customize how slugs are generated by modifying the `slug_generator` setting in your configuration file. Here's how:
107+
108+
1. Locate `frontend` section in the `config/inspirecms.php` file.
109+
110+
2. **Edit the Slug Generator**:
111+
Change the `slug_generator` to your custom class:
112+
```php
113+
'frontend' => [
114+
'slug_generator' => \App\CustomSlugGenerator::class,
115+
],
116+
```
117+
118+
3. **Create Your Custom Slug Generator**:
119+
Implement your custom slug generator class:
120+
```php
121+
namespace App;
122+
123+
use SolutionForest\InspireCms\Content\DefaultSlugGenerator;
124+
125+
class CustomSlugGenerator extends DefaultSlugGenerator {
126+
public function generate($text, $language = DefaultSlugGenerator::LANG_AUTO, $separator = '-') {
127+
// Custom logic for slug generation
128+
return strtolower(trim(preg_replace('/[^A-Za-z0-9-]+/', '-', $text)));
129+
}
130+
}
131+
```
132+
133+
4. **Test Your Changes**:
134+
After saving your configuration and custom class, create new content or edit existing content to see your custom slug generation in action.
135+
136+
82137
---
83138

84139
## Route Registration

docs/control-panel.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,10 @@
22
title: Control Panel
33
slug: control-panel
44
path: docs/v1/control-panel
5-
uri: /docs/1.x/control-panel
5+
uri: /docs/v1/control-panel
66
heading: Control Panel
7-
87
brief:
8+
quick_links: []
99
---
1010

1111
## Accessing the Control Panel
@@ -31,6 +31,8 @@ The path can be customized in your configuration if needed:
3131

3232
The control panel is organized into several main sections:
3333

34+
![Dashboard](https://inspirecms.net/storage/doc/V07Wy5bOcg2wwMD40qwBP32izQNvfi5F2eKEwZ8R.png)
35+
3436
1. **Content**: Manage pages, blog posts, and other content types
3537
2. **Media**: Upload and organize images, documents, and other media
3638
3. **Settings**: Configure system settings, templates, and site options

docs/custom-fields.md

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
11
---
2-
title:
2+
title: Custom Fields
33
slug: custom-fields
44
path: docs/v1/custom-fields
5-
uri: /docs/1.x/custom-fields
5+
uri: /docs/v1/custom-fields
66
heading: Custom Fields
77
brief:
8+
quick_links: []
89
---
910

1011
Note: This document depends on the [Filament Field Group](https://github.com/solutionforest/filament-field-group). Field types may not update automatically; for missing or updated field references, please consult that repository.
@@ -54,6 +55,9 @@ InspireCMS offers a wide range of field types for different content needs:
5455
Field groups organize related fields together. To create a field group:
5556

5657
1. Navigate to **Settings** > **Custom Fields** in the admin panel
58+
59+
![Setting_custom_fields](https://inspirecms.net/storage/doc/E8Bb2dfWuVYlpgGZtB2w53EPWheLQYT16YzYD6Rj.png)
60+
5761
2. Click **New Custom Fields**
5862
3. Add fields to the group using the form
5963
4. Enter a name and slug for your field group
@@ -65,8 +69,14 @@ Field groups organize related fields together. To create a field group:
6569
After creating field groups, associate them with document types:
6670

6771
1. Navigate to **Settings** > **Document Types**
72+
73+
![Setting_document_types](https://inspirecms.net/storage/doc/E0M1cUvrKfFvjMLqBUeUakAC4ZIuhKFz4nvAGLkn.png)
74+
6875
2. Create or edit a document type
6976
3. Under "Structures," select the relevant field groups
77+
78+
![select_field_group](https://inspirecms.net/storage/doc/TWqCvxdmz9jjT8pW0NG0vlMUJfrDsnldEK7KRp3L.png)
79+
7080
4. Save your document type
7181

7282
---

docs/customize-the-admin-panel.md

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,12 @@
22
title: Customize the Admin Panel
33
slug: customize-the-admin-panel
44
path: docs/v1/customize-the-admin-panel
5-
uri: /docs/1.x/customize-the-admin-panel
5+
uri: /docs/v1/customize-the-admin-panel
66
heading: Customize the Admin Panel
7-
brief: This guide explains how to customize and extend the admin panel to meet your specific needs, including creating custom resources, pages, widgets, and modifying the appearance to match your brand. Whether you need to add new functionality or tailor the existing features, InspireCMS offers multiple extension points for developers.
7+
brief: This guide explains how to customize and extend the admin panel to meet your specific needs, including creating custom resources, pages, widgets, and modifying the appearance to match your brand.
8+
9+
Whether you need to add new functionality or tailor the existing features, InspireCMS offers multiple extension points for developers.
10+
quick_links: []
811
---
912

1013
## Overview

0 commit comments

Comments
 (0)