Skip to content

Commit a61435b

Browse files
committed
Document changes in Coilpack 2.0
1 parent 23a4291 commit a61435b

File tree

8 files changed

+65
-16
lines changed

8 files changed

+65
-16
lines changed

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
![coilpack-logo](https://github.com/user-attachments/assets/5f161c5d-3944-413a-869f-26bea39e32c6)
2+
13
# Coilpack Documentation
24

35
This is the documentation for [Coilpack by ExpressionEngine](https://github.com/ExpressionEngine/Coilpack) built

docs/configuration.md

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,4 +20,18 @@ Certain configuration variables in ExpressionEngine will be overwritten by your
2020

2121
## Accessing ExpressionEngine Config Values
2222

23-
After Coilpack bootstraps ExpressionEngine you will be able to access any of your ExpressionEngine `system/user/config.php` values through the Laravel `config()` helper. For example to get your `app_version` you could call `config('coilpack.expressionengine.app_version')` within your Laravel application.
23+
After Coilpack bootstraps ExpressionEngine you will be able to access any of your ExpressionEngine `system/user/config.php` values through the Laravel `config()` helper. For example to get your `app_version` you could call `config('coilpack.expressionengine.app_version')` within your Laravel application.
24+
25+
## Default Template Engine
26+
27+
ExpressionEngine 7.5 added a new configuration option to control the site's default template engine. This setting will be considered whenever you create a new template, run a template generator or copy template code for a channel or field.
28+
29+
```
30+
# system/user/config/config.php
31+
32+
...
33+
/*
34+
* Set the default template engine
35+
* Default: null (native). Can be 'twig' or 'blade' with Coilpack
36+
*/
37+
$config['default_template_engine'] = 'twig';

docs/getting-started.md

Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -11,21 +11,22 @@ Read more about how URLs are handled inside of Coilpack in the [Routing Section]
1111
If you are new to Laravel and Coilpack we strongly recommend you follow the rest of this guide for getting started. However, if you have installed Coilpack before or are familiar with setting up a Laravel application you can get started quickly with the commands below.
1212

1313
```sh
14-
composer create-project --prefer-dist "laravel/laravel:<=10" project-name
14+
composer create-project --prefer-dist "laravel/laravel:<=11" project-name
1515
cd project-name
16-
composer require expressionengine/coilpack:1.x
16+
composer require expressionengine/coilpack:2.x
1717
php artisan coilpack
1818
```
1919

2020
## Choosing a Laravel Version
2121

22-
We recommend using the latest version of Laravel whenever possible. The only reason you should not use the latest version is if you are limited to a certain version of PHP. The table below shows which versions of Laravel are supported on different versions of PHP.
22+
We recommend using the latest version of Laravel whenever possible. The only reason you should not use the latest version is if you are limited to a certain version of PHP. The table below shows which versions of Laravel and Coilpack are supported on different versions of PHP.
2323

24-
| PHP | Laravel |
25-
| ------- | ------- |
26-
| 8.1.0+ | 10.x |
27-
| 8.0.2+ | 9.x |
28-
| 7.4.0+ | 8.x |
24+
| PHP | Laravel | Coilpack |
25+
| ------- | ------- | -------- |
26+
| 8.2.0+ | 11.x | 2.x |
27+
| 8.1.0+ | 10.x | 2.x, 1.x |
28+
| 8.0.2+ | 9.x | 2.x, 1.x |
29+
| 7.4.0+ | 8.x | 1.x |
2930

3031
## Installation
3132

@@ -43,7 +44,7 @@ composer create-project --prefer-dist laravel/laravel project-name
4344
Alternatively you can specify a major version of Laravel:
4445

4546
```sh
46-
composer create-project --prefer-dist laravel/laravel:^8.0 project-name
47+
composer create-project --prefer-dist laravel/laravel:^9.0 project-name
4748
```
4849

4950
:::caution
@@ -96,15 +97,15 @@ We recommend keeping your version of ExpressionEngine updated to the latest 7.x
9697

9798
### Using a New ExpressionEngine Install
9899

99-
If you want Coilpack to create a new ExpressionEngine install, it will be placed in an `ee` folder within your Laravel project. You now need to setup ExpressionEngine via the `admin.php` file in your `ee` folder. Example: `http://localhost/admin.php`. Follow the on-screen instructions to finalize your ExpressionEngine install.
100+
If you want Coilpack to create a new ExpressionEngine install, it will be placed in an `ee` folder within your Laravel project. You now need to setup ExpressionEngine via the installer. The default url is `/admin` for example: `http://localhost/admin`. Follow the on-screen instructions to finalize your ExpressionEngine install.
100101

101102
For more help with installing ExpressionEngine reference the [ExpressionEngine Docs](https://docs.expressionengine.com/latest/installation/installation.html).
102103

103104
### Using an Existing ExpressionEngine Install
104105

105106
If you want to use an existing ExpressionEngine install you will be prompted for a path that is accessible from your Laravel project. The path can be relative or absolute and should point to the root folder of your ExpressionEngine install. You will also be asked for relative paths to system and config folders. The typical locations are provided as default answers but if you have a customized setup it is important to let Coilpack know where to find these directories.
106107

107-
After you have linked your site with Coilpack you will need to change the way you access the site. For example if your ExpressionEngine site is located at `https://example.com`, and your Laravel application is setup to be accessed via `https://coilpack.example.com`, after setting up Coilpack you will need to access your ExpressionEngine site via `https://coilpack.example.com` (`https://coilpack.example.com/admin.php` to access the Control Panel).
108+
After you have linked your site with Coilpack you will need to change the way you access the site. For example if your ExpressionEngine site is located at `https://example.com`, and your Laravel application is setup to be accessed via `https://coilpack.example.com`, after setting up Coilpack you will need to access your ExpressionEngine site via `https://coilpack.example.com` (`https://coilpack.example.com/admin` to access the Control Panel).
108109

109110
For the sake of SEO, current links in place, etc, once you decide to use Coilpack for your website, you will probably want to update your webserver to point your site's current URL to your Laravel project. Talk to your webserver admin for information on how to accomplish this.
110111

docs/routing.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ Coilpack works by bootstrapping ExpressionEngine inside of a Laravel application
66

77
Coilpack sets up a few special routes for you:
88

9-
- `/admin.php` - Access the ExpressionEngine Control Panel
9+
- `/admin` - Access the ExpressionEngine Control Panel
1010
- `/graphql` - GraphQL Data endpoint when [GraphQL is enabled](./graphql#enabling-graphql-support)
1111
- `/graphiql` - Interactive GraphQL testing endpoint when [GraphiQL is enabled](./graphql#tools)
1212

docs/templates/generators.md

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
# Template Generators
2+
3+
Coilpack expands support for [ExpressionEngine's Template Generator](https://docs.expressionengine.com/latest/templates/generators.html) feature to include the Twig and Blade templating engines. This is accomplished by providing translations of ExpressionEngine's native template and fieldtype stubs.
4+
5+
## Usage
6+
7+
### Control Panel
8+
9+
The Channel and Field Manager display a shortname next to each item's title which you can click to copy example template code. This code will be generated using the site's [default template engine](/configuration#default-template-engine). If not specified this will use the Native Template Language so be sure to change this if you wish to copy code in Twig or Blade.
10+
11+
:::warning
12+
Due to security restrictions in modern browsers copying code via the shortname is only supported when on HTTPS.
13+
:::
14+
15+
When using Coilpack you will also notice that the `Developer > Templates > Template Generator` page will have an extra option for "Template Engine". You can select from the available options and the generated templates will use the proper syntax for your specified engine.
16+
17+
:::info
18+
If you generate a template that is missing a translated stub (perhaps a third-party fieldtype) ExpressionEngine will default back to the native syntax for that stub.
19+
:::
20+
21+
### Command Line Interface
22+
23+
You may access the Template Generator functionality through the Command Line Interface (CLI) as well by running `php artisan eecli generate:templates`. For more information about the available options please consult the [ExpressionEngine Documentation](https://docs.expressionengine.com/latest/templates/generators.html#command-line-usage)
24+
25+
## Add-on Development
26+
27+
If you are developing an add-on and wish to support Template Generators you should first familiarize yourself with the [Template Generator Service](https://docs.expressionengine.com/latest/development/services/template-generator.html).
28+
29+
You can add support for the Twig and Blade templating engines by creating additional stubs in your `addon_name/stubs` folder that use the template engine suffix. For instance if your add-on has a fieldtype your Native template stub might be `addon_name/stubs/field.php` and you could create a variant for Twig at `addon_name/stubs/field.twig.php` and similarly for Blade at `addon_name/stubs/field.blade.php`.
30+

docs/upgrade-guide.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,16 @@ You can upgrade to the latest version of Coilpack by running `composer update --
44

55
## Review the Changelog
66

7-
It's always a good idea to be aware of what is changing in each release. You can see a list of all changes in our [current changelog](https://github.com/ExpressionEngine/Coilpack/blob/1.x/CHANGELOG.md).
7+
It's always a good idea to be aware of what is changing in each release. You can see a list of all changes in our [current changelog](https://github.com/ExpressionEngine/Coilpack/blob/2.x/CHANGELOG.md).
88

99
## Configuration Changes
1010

11-
Between versions the Coilpack configuration file may change. We recommend comparing the most [recent changes](https://github.com/ExpressionEngine/Coilpack/blob/1.x/config/coilpack.php) with your own `config/coilpack.php` file.
11+
Between versions the Coilpack configuration file may change. We recommend comparing the most [recent changes](https://github.com/ExpressionEngine/Coilpack/blob/2.x/config/coilpack.php) with your own `config/coilpack.php` file.
1212

1313
## Upgrading to 2.0 from 1.x
1414

15+
The default value for `admin_url` has been changed from `/admin.php` to `/admin` to avoid routing issues with certain webserver configurations.
16+
1517
The GraphQL signature for the Range Slider Fieldtype has changed to allow requesting specific subfields like `value`, `from`, and `to`.
1618

1719
`Expressionengine\Coilpack\View\FormTag` has been deprecated in 2.0, so if you were extending this class please be aware and update your subclasses. The new trait `Expressionengine\Coilpack\View\Traits\CreatesHtmlForm` provides similar functionality.

docusaurus.config.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,6 @@ const config = {
7676
position: 'left',
7777
label: 'Documentation',
7878
},
79-
{ to: '/blog', label: 'Blog', position: 'left' },
8079
{
8180
type: 'search',
8281
position: 'right',

sidebars.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,7 @@ const sidebars = {
6464
{ type: 'autogenerated', dirName: 'templates/tags' },
6565
],
6666
},
67+
{ type: 'doc', id: 'templates/generators', label: 'Generators' },
6768
'templates/troubleshooting'
6869
]
6970
},

0 commit comments

Comments
 (0)