Forum


Replies: 1   Views: 1123
Listoverrideoptions start is not working?
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  · 22-10-2020 - 06:51

Hello,

All options included in phpdocx are fully tested and working. As the previous post (https://www.phpdocx.com/en/forum/default/topic/2020) that's behaviour is from MS Word, list override works in that way, some properties (such as start value) are inherited and they can't be overwritten. You need to set start as 1 in the main list style to set the level override start as 1, if you set it to 2 then level overrides start from 2. You can check this behaviour using MS Word too if you open the DOCX output and try to edit it.

From your code:

// set the start value of the first level of the list:

$joOpt[0]['start'] = 1;

// set the start value of the second level of the list:

$joOpt[1]['start'] = 2;

So as you are setting 2 as start in the second level, then items in that level start from 2, you can't overwritte it in the level override properties. Level override works in this way, to start 2nd level from 1 you need to set that value:

$joOpt[1]['start'] = 1;

Regards.