# Dynamic Content: Using a "URL" custom field token as the src in an img tag

**URL:** <https://forum.mautic.org/t/dynamic-content-using-a-url-custom-field-token-as-the-src-in-an-img-tag/29229>\
**Category:** Product Support\
**Created:** [September 8, 2023, 9:50pm UTC](https://forum.mautic.org/t/dynamic-content-using-a-url-custom-field-token-as-the-src-in-an-img-tag/29229 "2023-09-08T21:50:12Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![ericgr](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/ericgr/32/5505_2.png) [@ericgr](https://forum.mautic.org/u/ericgr)\
**Post date:** [September 8, 2023, 9:50pm UTC](https://forum.mautic.org/t/dynamic-content-using-a-url-custom-field-token-as-the-src-in-an-img-tag/29229/1 "2023-09-08T21:50:12Z")

</div>

**Your software**  
My Mautic version is: 3.43  
My PHP version is: 7.4  
My Database type and version is: MariaDB

**Your problem**  
My problem is:

As part of a campaign I’m using Dynamic Content embedded on a Wordpress site. The Dynamic content works fine, but I’m trying to display the logo of the Company associated with the contact who would see the Dynamic Content. The logo would change for different contacts depending on their Company.

I created a custom field of type “URL” and called it “organization-logo”. I then uploaded the logo into the media manager (it is NOT an “Asset”), so it has a real and complete URL that works correctly if I just paste the URL into the browser.

The Dynamic Content in HTML code view looks like this:

`<img src="{contactfield=organization_logo}" title="logo" width="239px" height="92px" style="cursor: pointer;">`

While everything else in the Dynamic Content renders correctly, the image appears broken when it renders, and when I “inspect” the rendered field using Chrome “Inspect” the src of the img is empty.

I’m guessing this has to do with the token being between two quotation marks but I can’t figure out how to escape those characters.

Any ideas?

Thank you!

---

<div class="post-metadata">

**Author:** ![ericgr](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/ericgr/32/5505_2.png) [@ericgr](https://forum.mautic.org/u/ericgr)\
**Post date:** [September 10, 2023, 8:08pm UTC](https://forum.mautic.org/t/dynamic-content-using-a-url-custom-field-token-as-the-src-in-an-img-tag/29229/2 "2023-09-10T20:08:44Z")

</div>

After further testing, I don’t believe the quotes are an issue. The issue seems to be that any custom fields created for “Company” are not being pulled through to the rendered Dynamic Content, even though the tokens are available.

I opened up another topic here: [Company Token Custom Fields not displaying in Dynamic Content block](https://forum.mautic.org/t/company-token-custom-fields-not-displaying-in-dynamic-content-block/29237)

---

<div class="post-metadata">

**Author:** ![robm](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/robm/32/260_2.png) [@robm](https://forum.mautic.org/u/robm)\
**Post date:** [September 11, 2023, 3:33pm UTC](https://forum.mautic.org/t/dynamic-content-using-a-url-custom-field-token-as-the-src-in-an-img-tag/29229/3 "2023-09-11T15:33:35Z")

</div>

Did you try with the wordpress short codes? instead of HTML?

---

<div class="post-metadata">

**Author:** ![ericgr](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/ericgr/32/5505_2.png) [@ericgr](https://forum.mautic.org/u/ericgr)\
**Post date:** [September 11, 2023, 5:50pm UTC](https://forum.mautic.org/t/dynamic-content-using-a-url-custom-field-token-as-the-src-in-an-img-tag/29229/4 "2023-09-11T17:50:10Z")

</div>

Hi @robm - thanks for replying. I am using the Wordpress shortcodes for dropping in the Dynamic Content Block, but the ‘tokens’ are placed within the Dynamic Content itself, inside Mautic. It’s the custom fields of type ‘company’ that don’t seem to come through. I can add the same custom field and make it part of a ‘contact’ and it works fine, so it does seem to be a bug.
