# PHP HTML Substitution?

**URL:** <https://forums.realmacsoftware.com/t/php-html-substitution/46920>\
**Category:** Elements API\
**Created:** [March 25, 2025, 1:31pm UTC](https://forums.realmacsoftware.com/t/php-html-substitution/46920 "2025-03-25T13:31:36Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![logrunner](https://avatars.discourse-cdn.com/v4/letter/l/59ef9b/32.png) [@logrunner](https://forums.realmacsoftware.com/u/logrunner)\
**Post date:** [March 25, 2025, 1:31pm UTC](https://forums.realmacsoftware.com/t/php-html-substitution/46920/1 "2025-03-25T13:31:36Z")

</div>

In my blog DevPack, I am using substitution codes that can be inserted into Text or Typography components and the Devpack will substitute those codes with the metadata values from a displayed post.

The codes (at the moment; there will be more) are:

- **{DATETIME}**
- **{CATEGORY}**
- **{TITLE}**
- **{SUMMARY}**

The problem comes with an image as there is now way to specify **{IMAGE}** in an Image component and override it with the image from the metadata.

So I am searching for **files/image-square.png** and replacing that with the image link from the metadata. Whilst this works well, it is obviously risky going forward if that default filename was to change?

I was wondering whether there was a way to manually input the the image link into the Image component to avoid this, so that **{IMAGE}** could be used?

Conversely, do I need to be worried by this?

---

<div class="post-metadata">

**Author:** ![logrunner](https://avatars.discourse-cdn.com/v4/letter/l/59ef9b/32.png) [@logrunner](https://forums.realmacsoftware.com/u/logrunner)\
**Post date:** [March 26, 2025, 6:49pm UTC](https://forums.realmacsoftware.com/t/php-html-substitution/46920/2 "2025-03-26T18:49:38Z")

</div>

Just an update on this, I did caught out! If you have a different web page at the root level, the default image files are name with the filename added to the front. So if you have a webpage called **blogging.php** , the associated default image file is named **blogging\_files/image-square.png**.

Anyway, with the assistance of ChatGPT, I now just check for **image-square.png** with any parent folder and that handles both cases. 🙂
