Skip to content

Commit

Permalink
Update docs using Symfony 4 structure
Browse files Browse the repository at this point in the history
  • Loading branch information
alexander-schranz committed Jan 14, 2020
1 parent 86d93d3 commit 5b2951b
Show file tree
Hide file tree
Showing 6 changed files with 21 additions and 24 deletions.
2 changes: 0 additions & 2 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,4 @@ Describe BC breaks/deprecations here. (remove this section if not needed)

#### To Do

- [ ] Update CHANGELOG.md
- [ ] Create documentation

20 changes: 11 additions & 9 deletions Resources/doc/dynamic.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ This part describes step by step how to create a dynamic form with this bundle.

## Basic Sulu Template

Create a template in `app/Resources/pages` which uses the content type of the bundle to select
Create a template in `config/templates/pages` which uses the content type of the bundle to select
one of the dynamic templates which can be created in the Sulu backend.

```xml
Expand All @@ -15,8 +15,8 @@ one of the dynamic templates which can be created in the Sulu backend.

<key>form</key>

<view>AppBundle:website:templates/pages/default</view>
<controller>SuluWebsiteBundle:Default:index</controller>
<view>pages/form</view>
<controller>Sulu\Bundle\WebsiteBundle\Controller\DefaultController::indexAction</controller>
<cacheLifetime>1209600</cacheLifetime>

<meta>
Expand All @@ -32,6 +32,7 @@ one of the dynamic templates which can be created in the Sulu backend.
<title lang="en">Title</title>
<title lang="de">Titel</title>
</meta>

<params>
<param name="headline" value="true"/>
</params>
Expand All @@ -55,6 +56,7 @@ one of the dynamic templates which can be created in the Sulu backend.
<title lang="de">Formular</title>
<title lang="en">Form</title>
</meta>

<params>
<param name="resourceKey" value="page"/>
</params>
Expand Down Expand Up @@ -105,17 +107,17 @@ For customizing the notification mail and the customer confirmation mail, adding
sulu_form:
mail:
templates:
notify: 'AppBundle:mails:dynamic-notify.html.twig'
notify_plain_text: 'AppBundle:mails:dynamic-notify-plain-text.html.twig'
customer: 'AppBundle:mails:dynamic-customer.html.twig'
customer_plain_text: 'AppBundle:mails:dynamic-customer-plain-text.html.twig'
notify: 'mails/dynamic-notify.html.twig'
notify_plain_text: 'mails/dynamic-notify-plain-text.html.twig'
customer: 'mails/dynamic-customer.html.twig'
customer_plain_text: 'mails/dynamic-customer-plain-text.html.twig'
```
Examples for the notification and costumer mail you can find [here](https://github.com/sulu/SuluFormBundle/tree/master/Resources/views/mails/).
## List Tab - Export
To visualise a tab in the Sulu template, simply configured the following in your `app/config/config.yml`:
To visualise a tab in the Sulu template, simply configured the following in your `config/packages/sulu_form.yaml`:

```yml
sulu_form:
Expand Down Expand Up @@ -166,7 +168,7 @@ php bin/adminconsole debug:container --tag=sulu_form.dynamic.type

## Media Collections

To create for every form and page an own collection you need to configure the following in your `config.yml`:
To create for every form and page an own collection you need to configure the following in your `config/packages/sulu_form.yaml`:

```yml
sulu_form:
Expand Down
5 changes: 2 additions & 3 deletions Resources/doc/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ Sulu\Bundle\FormBundle\SuluFormBundle::class => ['all' => true],
## Config

Activate esi for csrf token reload on cache pages
by change the following lines in `app/config/config.yml`.
by change the following lines in `config/packages/framework.yaml`.

```yml
framework:
Expand Down Expand Up @@ -64,7 +64,7 @@ php bin/adminconsole assets:install --symlink --relative

## Routing

Add the following lines to `app/config/admin/routing.yml`
Add the following lines to `config/routes/sulu_admin.yaml`

```yml
sulu_form_api:
Expand All @@ -91,4 +91,3 @@ Make sure you've set the correct permissions in the Sulu backend for this bundle
## Varnish
Using varnish have a look at the [CSRF](csrf.md "CSRF Token") documentation.
4 changes: 3 additions & 1 deletion Resources/doc/mailchimp.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ composer require drewm/mailchimp-api:^2.2

## Config

add the following config to `app/config/config.yml`
Add the following config to `config/packages/sulu_form.yaml`:

```yml
sulu_form:
Expand All @@ -37,9 +37,11 @@ To change the subscribe status from `subscribed` to `pending` you need to config
sulu_form:
mailchimp_subscribe_status: "pending"
```

https://developer.mailchimp.com/documentation/mailchimp/guides/manage-subscribers-with-the-mailchimp-api/#check-subscription-status

## Where is my Mailchimp API Key?

Account -> Extras -> Api Keys (create new / use existing)

or
Expand Down
10 changes: 3 additions & 7 deletions Resources/doc/recaptcha.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,19 +20,15 @@ or
composer require excelwebzone/recaptcha-bundle:^1.4.2
```

**Register Bundle in `app/AbstractKernel.php`**

Add the bundle the the AbstractKernel.
**Register Bundle in `config/bundles.php`**

```php
$bundles = [
new EWZ\Bundle\RecaptchaBundle\EWZRecaptchaBundle(),
];
EWZ\Bundle\RecaptchaBundle\EWZRecaptchaBundle::class ['all' => true],
```

## Config

add the following config to `app/config/config.yml`
add the following config to `config/packages/ewz_recaptcha.yaml`

```yml
ewz_recaptcha:
Expand Down
4 changes: 2 additions & 2 deletions Resources/doc/theming.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,14 +24,14 @@ Mostly you want a custom theme here a basic example for common customization
To use the new theme you must change the following line in your form rendering:

```twig
{% form_theme content.form 'AppBundle:themes:custom-dynamic.html.twig' %}
{% form_theme content.form 'themes/custom-dynamic.html.twig' %}
```

**Other theme customization**

For other block you can overwrites have a look at the

https://github.com/symfony/symfony/blob/2.8/src/Symfony/Bridge/Twig/Resources/views/Form/form_div_layout.html.twig
https://github.com/symfony/symfony/blob/4.4/src/Symfony/Bridge/Twig/Resources/views/Form/form_div_layout.html.twig

and

Expand Down

0 comments on commit 5b2951b

Please sign in to comment.