Skip to content

Commit

Permalink
fix web2print toc (#605)
Browse files Browse the repository at this point in the history
  • Loading branch information
fashxp authored Nov 11, 2024
1 parent 0325e9f commit 026442f
Showing 1 changed file with 25 additions and 25 deletions.
50 changes: 25 additions & 25 deletions templates/areas/print-toc/view.html.twig
Original file line number Diff line number Diff line change
@@ -1,31 +1,31 @@
{% do pimcore_head_script().appendFile(asset('/bundles/web2printtools/vendor/js/awesomizr.js')) %}

{% if not editmode %}
<script type="text/javascript">
$(document).ready(function() {
Awesomizr.createTableOfContents({
/* toc container */
insertiontarget: '#toc-wrapper',
insertiontype: 'beforeend',
/* levels to look for and link to in toc*/
elements: ['h1','h2'],
/* container element for the toc */
container: {tag: 'ul', addClass: 'toc'},
/* container element for one line in the toc */
line: {tag: 'li'},
disabledocumenttitle: true,
toctitle: ' ',
/* method of getting the text for the toc lines */
text: function (elem) {
return elem.textContent;
}
});
{% do pimcore_inline_script().appendFile(asset('/bundles/web2printtools/vendor/js/awesomizr.js')) %}

{% set inlineScript %}
$(document).ready(function() {
Awesomizr.createTableOfContents({
/* toc container */
insertiontarget: '#toc-wrapper',
insertiontype: 'beforeend',
/* levels to look for and link to in toc*/
elements: ['h1','h2'],
/* container element for the toc */
container: {tag: 'ul', addClass: 'toc'},
/* container element for one line in the toc */
line: {tag: 'li'},
disabledocumenttitle: true,
toctitle: ' ',

/* method of getting the text for the toc lines */
text: function (elem) {
return elem.textContent;
}
});

});
});
{% endset %}
{% do pimcore_inline_script().appendScript(inlineScript) %}

</script>
{% endif %}


Expand Down

0 comments on commit 026442f

Please sign in to comment.