/
exportword0e2d
488 lines (459 loc) · 16.8 KB
/
exportword0e2d
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
Message-ID: <524453939.4366.1485866294307.JavaMail.confluence@ip-10-127-227-164>
Subject: Exported From Confluence
MIME-Version: 1.0
Content-Type: multipart/related;
boundary="----=_Part_4365_485285985.1485866294307"
------=_Part_4365_485285985.1485866294307
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: quoted-printable
Content-Location: file:///C:/exported.html
<html xmlns:o=3D'urn:schemas-microsoft-com:office:office'
xmlns:w=3D'urn:schemas-microsoft-com:office:word'
xmlns:v=3D'urn:schemas-microsoft-com:vml'
xmlns=3D'urn:w3-org-ns:HTML'>
<head>
<meta http-equiv=3D"Content-Type" content=3D"text/html; charset=3Dutf-8=
">
<title>Legacy template fallback</title>
<!--[if gte mso 9]>
<xml>
<o:OfficeDocumentSettings>
<o:TargetScreenSize>1024x640</o:TargetScreenSize>
<o:PixelsPerInch>72</o:PixelsPerInch>
<o:AllowPNG/>
</o:OfficeDocumentSettings>
<w:WordDocument>
<w:View>Print</w:View>
<w:Zoom>90</w:Zoom>
<w:DoNotOptimizeForBrowser/>
</w:WordDocument>
</xml>
<![endif]-->
<style>
<!--
@page Section1 {
size: 8.5in 11.0in;
margin: 1.0in;
mso-header-margin: .5in;
mso-footer-margin: .5in;
mso-paper-source: 0;
}
td {
page-break-inside: avoid;
}
tr {
page-break-after: avoid;
}
div.Section1 {
page: Section1;
}
/* Confluence print stylesheet. Common to all themes for print medi=
a */
/* Full of !important until we improve batching for print CSS */
@media print {
#main {
padding-bottom: 1em !important; /* The default padding of 6em is to=
o much for printouts */
}
body {
font-family: Arial, Helvetica, FreeSans, sans-serif;
font-size: 10pt;
line-height: 1.2;
}
body, #full-height-container, #main, #page, #content, .has-personal-sid=
ebar #content {
background: #fff !important;
color: #000 !important;
border: 0 !important;
width: 100% !important;
height: auto !important;
min-height: auto !important;
margin: 0 !important;
padding: 0 !important;
display: block !important;
}
a, a:link, a:visited, a:focus, a:hover, a:active {
color: #000;
}
#content h1,
#content h2,
#content h3,
#content h4,
#content h5,
#content h6 {
font-family: Arial, Helvetica, FreeSans, sans-serif;
page-break-after: avoid;
}
pre {
font-family: Monaco, "Courier New", monospace;
}
#header,
.aui-header-inner,
#navigation,
#sidebar,
.sidebar,
#personal-info-sidebar,
.ia-fixed-sidebar,
.page-actions,
.navmenu,
.ajs-menu-bar,
.noprint,
.inline-control-link,
.inline-control-link a,
a.show-labels-editor,
.global-comment-actions,
.comment-actions,
.quick-comment-container,
#addcomment {
display: none !important;
}
.comment .date::before {
content: none !important; /* remove middot for print view */
}
h1.pagetitle img {
height: auto;
width: auto;
}
.print-only {
display: block;
}
#footer {
position: relative !important; /* CONF-17506 Place the footer at en=
d of the content */
margin: 0;
padding: 0;
background: none;
clear: both;
}
#poweredby {
border-top: none;
background: none;
}
#poweredby li.print-only {
display: list-item;
font-style: italic;
}
#poweredby li.noprint {
display: none;
}
/* no width controls in print */
.wiki-content .table-wrap,
.wiki-content p,
.panel .codeContent,
.panel .codeContent pre,
.image-wrap {
overflow: visible !important;
}
/* TODO - should this work? */
#children-section,
#comments-section .comment,
#comments-section .comment .comment-body,
#comments-section .comment .comment-content,
#comments-section .comment p {
page-break-inside: avoid;
}
#page-children a {
text-decoration: none;
}
/**
hide twixies
the specificity here is a hack because print styles
are getting loaded before the base styles. */
#comments-section.pageSection .section-header,
#comments-section.pageSection .section-title,
#children-section.pageSection .section-header,
#children-section.pageSection .section-title,
.children-show-hide {
padding-left: 0;
margin-left: 0;
}
.children-show-hide.icon {
display: none;
}
/* personal sidebar */
.has-personal-sidebar #content {
margin-right: 0px;
}
.has-personal-sidebar #content .pageSection {
margin-right: 0px;
}
}
-->
</style>
</head>
<body>
<h1>Legacy template fallback</h1>
<div class=3D"Section1">
<div class=3D"confluence-information-macro confluence-information-m=
acro-note">
<span class=3D"aui-icon aui-icon-small aui-iconfont-warning confluence-info=
rmation-macro-icon"></span>
<div class=3D"confluence-information-macro-body">
<p>The following does not apply to siteaccesses configured with <code>legac=
y_mode: true</code></p>
</div>
</div>
<p> </p>
<p>When the standard view provider is not able to select an appropriate tem=
plate for a given content, <strong>the system fallbacks to the legacy kerne=
l and delegates the view selection to it</strong>. <span style=3D"font=
-size: 10.0pt;line-height: 13.0pt;">This ensures that a content is always d=
isplayed and hence eases project migration from eZ Publish v4.x to v5.x</sp=
an></p>
<p><span style=3D"font-size: 10.0pt;line-height: 13.0pt;"><style type=3D"te=
xt/css">/*<![CDATA[*/
div.rbtoc1485866294280 {padding: 0px;}
div.rbtoc1485866294280 ul {list-style: disc;margin-left: 0px;}
div.rbtoc1485866294280 li {margin-left: 0px;padding-left: 0px;}
/*]]>*/</style></span></p>
<div class=3D"toc-macro rbtoc1485866294280">=20
<ul class=3D"toc-indentation">=20
<li><a href=3D"#Legacytemplatefallback-Pagelayoutandmainblock">Pagelayout a=
nd main block</a>=20
<ul class=3D"toc-indentation">=20
<li><a href=3D"#Legacytemplatefallback-Baselayoutforlegacyfallback">Base la=
yout for legacy fallback</a></li>=20
<li><a href=3D"#Legacytemplatefallback-Blockname">Block name</a></li>=20
<li><a href=3D"#Legacytemplatefallback-Modulelayout">Module layout</a>=20
<ul class=3D"toc-indentation">=20
<li><a href=3D"#Legacytemplatefallback-Displayinglegacymoduleresult">Displa=
ying legacy module result</a></li>=20
</ul> </li>=20
</ul> </li>=20
<li><a href=3D"#Legacytemplatefallback-Persistentvariable">Persistent varia=
ble</a></li>=20
<li><a href=3D"#Legacytemplatefallback-Assets">Assets</a></li>=20
</ul>=20
</div>
<br>
<p></p>
<h2 id=3D"Legacytemplatefallback-Pagelayoutandmainblock">Pagelayout and mai=
n block</h2>
<p>When falling back to the legacy kernel, <strong>the old <code>content/vi=
ew</code> module is run</strong> to return the appropriate view for the giv=
en content. However, the pagelayout is not rendered as it needs to be still=
rendered by Twig in the Symfony part, for consistency. In this regard, the=
system uses the <strong>Decorator design pattern</strong> to include the g=
enerated view in your layout.</p>
<p>For this to work, you need to configure 2 things :</p>
<ol>
<li>Which template you want to use as a base template for legacy fallback</=
li>
<li>The name of the block to use in your layout</li>
</ol>
<h3 id=3D"Legacytemplatefallback-Baselayoutforlegacyfallback">Base layout f=
or legacy fallback</h3>
<p>You can configure this by setting the <code><strong>ezpublish_legac=
y.<siteaccess_or_siteaccess_group>.view_default_layout</strong></code=
> config key.</p>
<p><strong>Example:</strong></p>
<div class=3D"code panel pdl" style=3D"border-width: 1px;">
<div class=3D"codeHeader panelHeader pdl" style=3D"border-bottom-width: 1px=
;">
<b>ezpublish/config/ezpublish.yml</b>
</div>
<div class=3D"codeContent panelContent pdl">=20
<pre class=3D"brush: php; gutter: false; theme: Eclipse" style=3D"font-size=
:12px;">parameters:
# eZ Publish 5.1+ only
ezpublish_legacy.my_siteaccess.view_default_layout: AcmeDemoBundle::my_=
layout.html.twig</pre>=20
</div>
</div>
<h3 id=3D"Legacytemplatefallback-Blockname">Block name</h3>
<p>Internally when rendering the view coming from the legacy kernel, a Twig=
template is created on the fly. This template extends the pagelayout you c=
onfigured and includes the content inside a block. The name of this block i=
s configurable as well (default is <code><strong>content</strong></code>).<=
/p>
<div class=3D"code panel pdl" style=3D"border-width: 1px;">
<div class=3D"codeHeader panelHeader pdl" style=3D"border-bottom-width: 1px=
;">
<b>ezpublish/config/ezpublish.yml</b>
</div>
<div class=3D"codeContent panelContent pdl">=20
<pre class=3D"brush: php; gutter: false; theme: Eclipse" style=3D"font-size=
:12px;">parameters:
ezpublish_legacy.<siteaccess_or_siteaccess_group>.view_default_la=
yout: AcmeDemoBundle::my_layout.html.twig
ezpublish.content_view.content_block_name: content</pre>=20
</div>
</div>
<div class=3D"code panel pdl" style=3D"border-width: 1px;">
<div class=3D"codeHeader panelHeader pdl" style=3D"border-bottom-width: 1px=
;">
<b>my_layout.html.twig</b>
</div>
<div class=3D"codeContent panelContent pdl">=20
<pre class=3D"brush: php; gutter: false; theme: Eclipse" style=3D"font-size=
:12px;"><!DOCTYPE html>
<html>
<head>
<!-- ... -->
</head>
<body>
{% block content %}{# Content will be inserted here #}{% endblock %}
</body>
</html></pre>=20
</div>
</div>
<p> </p>
<h3 id=3D"Legacytemplatefallback-Modulelayout">Module layout</h3>
<div class=3D"confluence-information-macro confluence-information-macro-inf=
ormation">
<p class=3D"title">Version compatibility</p>
<span class=3D"aui-icon aui-icon-small aui-iconfont-info confluence-informa=
tion-macro-icon"></span>
<div class=3D"confluence-information-macro-body">
<p>The module layout setting is available from eZ Publish 5.1.</p>
</div>
</div>
<p><span style=3D"font-size: 10.0pt;line-height: 13.0pt;">The module layout=
can also be defined the same way as the base layout, by setting the <=
/span><code style=3D"font-size: 10.0pt;line-height: 13.0pt;"><strong>ezpubl=
ish_legacy.<scope>.module_default_layout</strong></code><span style=
=3D"font-size: 10.0pt;line-height: 13.0pt;"> config key. This layout is use=
d to handle "non content" related legacy requests.</span></p>
<h4 id=3D"Legacytemplatefallback-Displayinglegacymoduleresult">Displaying l=
egacy module result</h4>
<p>This makes your base layout reusable. However, content generated by lega=
cy modules (i.e. <code>/ezinfo/about</code>) will not be automatically inse=
rted as your layout will be rendered as a regular template, receiving <code=
>module_result</code> variable coming from the legacy kernel. The solution =
is to use 2 different templates, one for the global layout, and another for=
legacy module rendering:</p>
<div class=3D"code panel pdl" style=3D"border-width: 1px;">
<div class=3D"codeHeader panelHeader pdl" style=3D"border-bottom-width: 1px=
;">
<b>AcmeDemoBundle::layout.html.twig</b>
</div>
<div class=3D"codeContent panelContent pdl">=20
<pre class=3D"brush: php; gutter: false; theme: Eclipse" style=3D"font-size=
:12px;"><!DOCTYPE html>
<html>
<head>
<!-- Insert everything you need here that is common -->
</head>
<body>
{% block content %}{# Regular content will be inserted here #}{% endblo=
ck %}
</body>
</html></pre>=20
</div>
</div>
<div class=3D"code panel pdl" style=3D"border-width: 1px;">
<div class=3D"codeHeader panelHeader pdl" style=3D"border-bottom-width: 1px=
;">
<b>AcmeDemoBundle::layout_legacy.html.twig</b>
</div>
<div class=3D"codeContent panelContent pdl">=20
<pre class=3D"brush: php; gutter: false; theme: Eclipse" style=3D"font-size=
:12px;">{% extends "AcmeDemoBundle::layout.html.twig" %}
{% block content %}
{# module_result variable is received from the legacy controller. #}
{# It holds the legacy module result #}
{{ module_result.content|raw }}
{% endblock %}</pre>=20
</div>
</div>
<div class=3D"code panel pdl" style=3D"border-width: 1px;">
<div class=3D"codeHeader panelHeader pdl" style=3D"border-bottom-width: 1px=
;">
<b>ezpublish/config/ezpublish.yml</b>
</div>
<div class=3D"codeContent panelContent pdl">=20
<pre class=3D"brush: php; gutter: false; theme: Eclipse" style=3D"font-size=
:12px;">parameters:
ezpublish_legacy.my_siteaccess.module_default_layout: AcmeDemoBundle::l=
ayout_legacy.html.twig
ezpublish_legacy.my_siteaccess.view_default_layout: AcmeDemoBundle::lay=
out.html.twig</pre>=20
</div>
</div>
<p> </p>
<h2 id=3D"Legacytemplatefallback-Persistentvariable">Persistent variable</h=
2>
<p>The persistent variable is a special variable in legacy templates that y=
ou can set in order to pass values from the content template to the pagelay=
out. This variable, among others, is accessible from the configured Twig pa=
gelayout thanks to the helper <code><strong>ezpublish.legacy</strong></code=
>.</p>
<p>Actually, all data <a href=3D"http://doc.ez.no/eZ-Publish/Technical-manu=
al/4.x/Templates/The-pagelayout/Variables-in-pagelayout#module_result" clas=
s=3D"external-link" rel=3D"nofollow">contained in <code>$module_result</cod=
e> in the legacy kernel</a> is exposed.</p>
<div class=3D"code panel pdl" style=3D"border-width: 1px;">
<div class=3D"codeHeader panelHeader pdl" style=3D"border-bottom-width: 1px=
;">
<b>Access to the persistent variable</b>
</div>
<div class=3D"codeContent panelContent pdl">=20
<pre class=3D"brush: php; gutter: false; theme: Eclipse" style=3D"font-size=
:12px;"><!DOCTYPE html>
<html>
<head>
<!-- ... -->
{% if ezpublish.legacy.has( 'content_info' ) %}
{% set persistent_variable =3D ezpublish.legacy.get( 'content_info'=
)['persistent_variable'] %}
{% endif %}
</head>
<body>
{% block content %}{# Content will be inserted here #}{% endblock %}
</body>
</html></pre>=20
</div>
</div>
<h2 id=3D"Legacytemplatefallback-Assets">Assets</h2>
<p>Like the persistent variable, it is possible to require css and/or javas=
cripts assets from a content template through the legacy <code>ezscript_req=
uire()</code> and <code>ezcss_require()</code> template operators.</p>
<p>You can easily retrieve those requested assets from the legacy template =
in the Twig pagelayout with the <code><strong>ezpublish.legacy</strong></co=
de> helper.</p>
<div class=3D"code panel pdl" style=3D"border-width: 1px;">
<div class=3D"codeHeader panelHeader pdl" style=3D"border-bottom-width: 1px=
;">
<b>Getting assets requested from a legacy template</b>
</div>
<div class=3D"codeContent panelContent pdl">=20
<pre class=3D"brush: php; gutter: false; theme: Eclipse" style=3D"font-size=
:12px;"><!DOCTYPE html>
<html>
<head>
<!-- ... -->
{% set requested_css_files =3D ezpublish.legacy.get( 'css_files' ) %}
{% set requested_js_files =3D ezpublish.legacy.get( 'js_files' ) %}
{# "configured" assets are the ones defined in design.ini (FrontendCSSF=
ileList/FrontendJavaScriptList) #}
{% set configured_js_files =3D ezpublish.legacy.get( 'js_files_configur=
ed' ) %}
{% set configured_css_files =3D ezpublish.legacy.get( 'css_files_config=
ured' ) %}
</head>
<body>
{% block content %}{# Content will be inserted here #}{% endblock %}
</body>
</html></pre>=20
</div>
</div>
<div class=3D"confluence-information-macro confluence-information-macro-not=
e">
<p class=3D"title">Assetic incompatibility</p>
<span class=3D"aui-icon aui-icon-small aui-iconfont-warning confluence-info=
rmation-macro-icon"></span>
<div class=3D"confluence-information-macro-body">
<p><strong>Warning:</strong> If you use Assetic to combine and/or compress =
your assets, please note that <a href=3D"http://symfony.com/doc/current/coo=
kbook/assetic/asset_management.html#assets" class=3D"external-link" rel=3D"=
nofollow"><code>javascripts</code> and <code>stylesheets</code> Twig tags</=
a> currently don't support variable file lists, so you won't be able to use=
them with the example above.</p>
</div>
</div>
</div>
</body>
</html>
------=_Part_4365_485285985.1485866294307--