Replies: 3   Views: 3667
Replaceplaceholderimage doesn't have option to add url
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 rmhosting  · 26-05-2016 - 19:10

I'm trying to replace a placeholder image and that part is working fine, but I haven't found anywhere where I can link this image to a url.. Is this even possible?

Posted by admin  · 27-05-2016 - 06:15


To add a link to the image you should work with WordFragments, this is the method replaceVariableByWordFragment. The replacePlaceholderImage only replace the image.


Posted by rmhosting  · 27-05-2016 - 11:26

OK but how would that work? In the examples/documents I don't see images being linked only text. 

Posted by admin  · 30-05-2016 - 07:17


Our apologizes, image's links are using their own tags instead of the used by texts so it can't be replaced easily using the current version of phpdocx.

You can set a placeholder such as $VAR_IMAGE_URL$ in the URL image field and this var may be replaced by a new value. Please send us an email to contact[at] and we'll send you a patch to be able to do this kind of replacement.