Forum


Replies: 1   Views: 2765
On replacement block contents block issues after cloning
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  · 31-08-2017 - 10:26

Hello,

Which version and license of phpdocx are you using?

About your question, if we understand it fine, you can clone a block using this method:

https://www.phpdocx.com/api-documentation/docx-path/clone-blocks-in-docx

Or clone a single content using this method:

https://www.phpdocx.com/api-documentation/docx-path/clone-elements-in-docx

After you have cloned the block, you can replace the first placeholder using the firstMatch option available in the template methods, then use this same option to replace the next match and so on. Or use DOCXPath with a customQuery.

Regards.