Skip to content
This repository was archived by the owner on Mar 13, 2026. It is now read-only.

Commit ee30deb

Browse files
committed
update theme variables to FC. add docs
1 parent 1aae6f4 commit ee30deb

File tree

5 files changed

+56
-23
lines changed

5 files changed

+56
-23
lines changed

CHANGELOG-1.5.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,9 @@ CHANGELOG - ZIKULA 1.5.x
4848
https://symfony.com/blog/new-in-symfony-3-2-runtime-environment-variables
4949
- `\Zikula\Component\SortableColumns\Column#setIsSortColumn()` is deprecated. Use `setSortColumn() instead.
5050
- The `MetaTagExtension` class is deprecated which includes the Twig function named `setMetaTag`. Use `pageSetVar` instead.
51+
- Using simple strings as form types in a theme's variables.yml is deprecated, use FqCN instead.
52+
- Form options are similarly modified, for example a `choices` array must be formatted according to Symfony's
53+
rules with respect to `choices_as_values`, etc. This changes from Core-1.5 to Core-2.0 which adopts Symfony 3
5154

5255
- Fixes:
5356
- Corrected path to legacy module's admin icons.

src/docs/Themes/ThemeVariables.md

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
Theme Variables
2+
===============
3+
4+
filepath: `/Resources/config/variables.yml`
5+
6+
The contents of this file can vary. At the very list, it can be a list of variables and values
7+
that will be passed along to the theme engine as global variables within your theme, e.g.:
8+
9+
{{ themevars.<variablename> }}
10+
11+
Additionally, dynamically created forms (using the symfony form engine) can be used by creating a yml definition like so:
12+
13+
home:
14+
default_value: 3col_w_centerblock
15+
type: 'Symfony\Component\Form\Extension\Core\Type\ChoiceType'
16+
options:
17+
choices_as_values: true
18+
choices:
19+
'One column': 1col
20+
'Two columns': 2col
21+
'Two columns with centerblock': 2col_w_centerblock
22+
'Three columns': 3col
23+
'Three columns with centerblock': 3col_w_centerblock
24+
25+
These pseudo-forms are created an available to the site admin through the Theme Module UI. The selected value then
26+
becomes available to templates as referenced above.

src/themes/AtomTheme/Resources/config/variables.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
##
44
showdescription:
55
default_value: true
6-
type: checkbox
6+
type: 'Symfony\Component\Form\Extension\Core\Type\CheckboxType'
77
options:
88
label: "Show item descriptions"
99
disabled: true

src/themes/BootstrapTheme/Resources/config/variables.yml

Lines changed: 21 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -3,31 +3,34 @@
33
##
44
home:
55
default_value: 3col_w_centerblock
6-
type: choice
6+
type: 'Symfony\Component\Form\Extension\Core\Type\ChoiceType'
77
options:
8+
choices_as_values: true
89
choices:
9-
1col: One column
10-
2col: Two columns
11-
2col_w_centerblock: Two columns with centerblock
12-
3col: Three columns
13-
3col_w_centerblock: Three columns with centerblock
10+
'One column': 1col
11+
'Two columns': 2col
12+
'Two columns with centerblock': 2col_w_centerblock
13+
'Three columns': 3col
14+
'Three columns with centerblock': 3col_w_centerblock
1415
master:
1516
default_value: 2col
16-
type: choice
17+
type: 'Symfony\Component\Form\Extension\Core\Type\ChoiceType'
1718
options:
19+
choices_as_values: true
1820
choices:
19-
1col: One column
20-
2col: Two columns
21-
2col_w_centerblock: Two columns with centerblock
22-
3col: Three columns
23-
3col_w_centerblock: Three columns with centerblock
21+
'One column': 1col
22+
'Two columns': 2col
23+
'Two columns with centerblock': 2col_w_centerblock
24+
'Three columns': 3col
25+
'Three columns with centerblock': 3col_w_centerblock
2426
admin:
2527
default_value: 1col
26-
type: choice
28+
type: 'Symfony\Component\Form\Extension\Core\Type\ChoiceType'
2729
options:
30+
choices_as_values: true
2831
choices:
29-
1col: One column
30-
2col: Two columns
31-
2col_w_centerblock: Two columns with centerblock
32-
3col: Three columns
33-
3col_w_centerblock: Three columns with centerblock
32+
'One column': 1col
33+
'Two columns': 2col
34+
'Two columns with centerblock': 2col_w_centerblock
35+
'Three columns': 3col
36+
'Three columns with centerblock': 3col_w_centerblock

src/themes/RssTheme/Resources/config/variables.yml

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,15 +3,16 @@
33
##
44
showdescription:
55
default_value: true
6-
type: checkbox
6+
type: 'Symfony\Component\Form\Extension\Core\Type\CheckboxType'
77
options:
88
label: "Show item descriptions"
99
disabled: true
1010
rsslevel:
1111
default_value: rss20
12-
type: choice
12+
type: 'Symfony\Component\Form\Extension\Core\Type\ChoiceType'
1313
options:
14+
choices_as_values: true
1415
label: "RSS Version"
1516
choices:
16-
rss091: "RSS v0.91"
17-
rss20: "RSS v0.20"
17+
"RSS v0.91": rss091
18+
"RSS v0.20": rss20

0 commit comments

Comments
 (0)