Forum


Replies: 4   Views: 461
Custom list style & bold using html extended with stylesreplacementtype
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  · 16-08-2023 - 22:10

Hello,

What version of phpdocx are you using? Your username doesn't have any license tied, please send to contact[at]phpdocx.com the username or email of the user that pruchased the license you are using.

Your code is not applying the custom list style correctly. Please check the embedHTML/sample_2.php script included in the package, you need to set the class name:

$latinListOptions = array();
$latinListOptions[0]['type'] = 'lowerLetter';
$latinListOptions[0]['format'] = '%1.';
$latinListOptions[1]['type'] = 'lowerRoman';
$latinListOptions[1]['format'] = '%1.%2.';
$docx->createListStyle('latin', $latinListOptions);

$html = '
<ul class="latin">
    <li>First item.</li>
    <li>Second item with subitems:
        <ul>
            <li>First subitem.</li>
            <li>Second subitem.</li>
        </ul>
    </li>
    <li>Third item.</li>
</ul>';
$docx->embedHTML($html, array('customListStyles' => true));

Also note that using 'stylesReplacementType' => 'mixPlaceholderStyles' you are requesting to mix placeholder and HTML styles. Please check the stylesReplacementType and the available options, maybe you don't need to use that option.

Regards.