Forum


Replies: 1   Views: 1893
Wrong lists rendering
Topic closed:
Please note this is an old forum thread. Information in this post may be out-to-date and/or erroneous.
Every phpdocx version includes new features and improvements. Previously unsupported features may have been added to newer releases, or past issues may have been corrected.
We encourage you to download the current phpdocx version and check the Documentation available.

Posted by admin  · 09-12-2019 - 18:03

Hello,

That kind of list styles uses overwriting level styles from MS Word, that are supported since phpdocx 9.5 (https://www.phpdocx.com/news/post/phpdocx-v9-5-release-notes/219) but only in addList and createListStyle. They'll be supported in HTML methods in the next release of phpdocx, as it's a work in progress.

Using the current version of phpdocx, the approach to be used would be adding placeholders in the positions to add the lists:

<ol class="list-upper-roman">
    <li>UPPER ROMAN 1
        $LIST_1$
    </li>
    <li>UPPER ROMAN 2</li>
    <li>UPPER ROMAN 3</li>
    <li>UPPER ROMAN 4
        $LIST_2$
    </li>
</ol>

and then use replaceVariableByWordFragment or replaceWordContent from DOCXPath to replace the placeholders with the new lists.

Regards.