Commit f4058bc 1 parent 2548916 commit f4058bc Copy full SHA for f4058bc
File tree 5 files changed +31
-6
lines changed
tests/DependencyInjection
5 files changed +31
-6
lines changed Original file line number Diff line number Diff line change @@ -42,8 +42,11 @@ Full configuration options:
42
42
stylesheets :
43
43
# Defaults:
44
44
- bundles/sonatapage/app.css
45
- - bundles/sonatapage/frontend.css
46
45
javascripts :
46
+ frontend_stylesheets :
47
+ # Defaults:
48
+ - bundles/sonatapage/frontend.css
49
+ frontend_javascripts :
47
50
templates : # Required
48
51
# Prototype
49
52
id :
Original file line number Diff line number Diff line change @@ -121,6 +121,13 @@ SonataPageBundle Configuration
121
121
not_found : [404] # render 404 page with "not_found" key (name generated: _page_internal_error_{key})
122
122
fatal : [500] # so you can use the same page for different http errors or specify specific page for each error
123
123
124
+ # Add custom css and js for your pages.
125
+ # assets:
126
+ # frontend_javascripts:
127
+ # - js/your.js
128
+ # frontend_stylesheets:
129
+ # - css/your.css
130
+
124
131
SonataAdminBundle Configuration
125
132
-------------------------------
126
133
Original file line number Diff line number Diff line change @@ -138,14 +138,23 @@ public function getConfigTreeBuilder(): TreeBuilder
138
138
->arrayNode ('stylesheets ' )
139
139
->defaultValue ([
140
140
'bundles/sonatapage/app.css ' ,
141
- 'bundles/sonatapage/frontend.css ' ,
142
141
])
143
142
->prototype ('scalar ' )->end ()
144
143
->end ()
145
144
->arrayNode ('javascripts ' )
146
145
->defaultValue ([])
147
146
->prototype ('scalar ' )->end ()
148
147
->end ()
148
+ ->arrayNode ('frontend_stylesheets ' )
149
+ ->defaultValue ([
150
+ 'bundles/sonatapage/frontend.css ' ,
151
+ ])
152
+ ->prototype ('scalar ' )->end ()
153
+ ->end ()
154
+ ->arrayNode ('frontend_javascripts ' )
155
+ ->defaultValue ([])
156
+ ->prototype ('scalar ' )->end ()
157
+ ->end ()
149
158
->end ()
150
159
->end ()
151
160
Original file line number Diff line number Diff line change @@ -21,7 +21,7 @@ file that was distributed with this source code.
21
21
22
22
{% block sonata_page_stylesheets %}
23
23
{% block page_stylesheets %} {# Deprecated block #}
24
- {% for stylesheet in sonata_page .assets .stylesheets %}
24
+ {% for stylesheet in sonata_page .assets .frontend_stylesheets %}
25
25
<link rel =" stylesheet" href =" {{ asset(stylesheet ) }}" media =" all" >
26
26
{% endfor %}
27
27
{% endblock %}
@@ -34,7 +34,7 @@ file that was distributed with this source code.
34
34
<script src="http://html5shim.googlecode.com/svn/trunk/html5.js"></script>
35
35
<![endif]-->
36
36
37
- {% for js in sonata_page .assets .javascripts %}
37
+ {% for js in sonata_page .assets .frontend_javascripts %}
38
38
<script src =" {{ asset(js ) }}" ></script >
39
39
{% endfor %}
40
40
{% endblock %}
Original file line number Diff line number Diff line change @@ -124,9 +124,12 @@ public function testPageWithMatrix(): void
124
124
'assets ' => [
125
125
'stylesheets ' => [
126
126
'bundles/sonatapage/app.css ' ,
127
- 'bundles/sonatapage/frontend.css ' ,
128
127
],
129
128
'javascripts ' => [],
129
+ 'frontend_stylesheets ' => [
130
+ 'bundles/sonatapage/frontend.css ' ,
131
+ ],
132
+ 'frontend_javascripts ' => [],
130
133
],
131
134
'templates_admin ' => [
132
135
'list ' => '@SonataPage/PageAdmin/list.html.twig ' ,
@@ -194,9 +197,12 @@ public function testPageWithoutMatrix(): void
194
197
'assets ' => [
195
198
'stylesheets ' => [
196
199
'bundles/sonatapage/app.css ' ,
197
- 'bundles/sonatapage/frontend.css ' ,
198
200
],
199
201
'javascripts ' => [],
202
+ 'frontend_stylesheets ' => [
203
+ 'bundles/sonatapage/frontend.css ' ,
204
+ ],
205
+ 'frontend_javascripts ' => [],
200
206
],
201
207
'templates_admin ' => [
202
208
'list ' => '@SonataPage/PageAdmin/list.html.twig ' ,
You can’t perform that action at this time.
0 commit comments