Forum


Replies: 1   Views: 1117
Replacevariablebyhtml using block parameter replaces the entire line of the variable
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  · 19-07-2021 - 08:29

Hello,

On the API documentation page of the method (https://www.phpdocx.com/api-documentation/templates/replace-variable-html-Word-document) you can read about the available replacement types:

type

The substitution type, it can be:

"block": the variable, together with its containing paragraph, is replaced by the HTML content.
"inline": only the variable is replaced by the inline HTML content.

A block replacement removes the paragraph content and add the new HTML (block and inline contents). An inline replacement keeps the existing contents in the paragraph of the placeholder but adds only the inline contents from the HTML. There's no replacement type to do an inline replacement keeping block contents from the HTML.

Regards.