Skip to content

Commit 026442f

Browse files
authored
fix web2print toc (#605)
1 parent 0325e9f commit 026442f

File tree

1 file changed

+25
-25
lines changed

1 file changed

+25
-25
lines changed

templates/areas/print-toc/view.html.twig

Lines changed: 25 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,31 +1,31 @@
1-
{% do pimcore_head_script().appendFile(asset('/bundles/web2printtools/vendor/js/awesomizr.js')) %}
2-
31
{% if not editmode %}
4-
<script type="text/javascript">
5-
6-
$(document).ready(function() {
7-
Awesomizr.createTableOfContents({
8-
/* toc container */
9-
insertiontarget: '#toc-wrapper',
10-
insertiontype: 'beforeend',
11-
/* levels to look for and link to in toc*/
12-
elements: ['h1','h2'],
13-
/* container element for the toc */
14-
container: {tag: 'ul', addClass: 'toc'},
15-
/* container element for one line in the toc */
16-
line: {tag: 'li'},
17-
disabledocumenttitle: true,
18-
toctitle: ' ',
19-
20-
/* method of getting the text for the toc lines */
21-
text: function (elem) {
22-
return elem.textContent;
23-
}
24-
});
2+
{% do pimcore_inline_script().appendFile(asset('/bundles/web2printtools/vendor/js/awesomizr.js')) %}
3+
4+
{% set inlineScript %}
5+
$(document).ready(function() {
6+
Awesomizr.createTableOfContents({
7+
/* toc container */
8+
insertiontarget: '#toc-wrapper',
9+
insertiontype: 'beforeend',
10+
/* levels to look for and link to in toc*/
11+
elements: ['h1','h2'],
12+
/* container element for the toc */
13+
container: {tag: 'ul', addClass: 'toc'},
14+
/* container element for one line in the toc */
15+
line: {tag: 'li'},
16+
disabledocumenttitle: true,
17+
toctitle: ' ',
18+
19+
/* method of getting the text for the toc lines */
20+
text: function (elem) {
21+
return elem.textContent;
22+
}
23+
});
2524

26-
});
25+
});
26+
{% endset %}
27+
{% do pimcore_inline_script().appendScript(inlineScript) %}
2728

28-
</script>
2929
{% endif %}
3030

3131

0 commit comments

Comments
 (0)