# Relative asset urls aren't working as expected

**URL:** <https://discourse.getcockpit.com/t/relative-asset-urls-arent-working-as-expected/835>\
**Category:** Uncategorized\
**Created:** [May 17, 2019, 7:39pm UTC](https://discourse.getcockpit.com/t/relative-asset-urls-arent-working-as-expected/835 "2019-05-17T19:39:32Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![jasonday](https://avatars.discourse-cdn.com/v4/letter/j/67e7ee/32.png) [@jasonday](https://discourse.getcockpit.com/u/jasonday)\
**Post date:** [May 17, 2019, 7:39pm UTC](https://discourse.getcockpit.com/t/relative-asset-urls-arent-working-as-expected/835/1 "2019-05-17T19:39:32Z")

</div>

Site url:  
[http://mysite.com/dev/](http://mysite.com/dev/)

cockpit url:  
[http://mysite.com/dev/cockpit](http://mysite.com/dev/cockpit)

If I set site\_url: “[http://mysite.com/dev/](http://mysite.com/dev/)” then when I upload and insert an image through the WYSIWYG editor, the image does not show in the WYSIWYG editor, but does show in the source and will show on the front end of the site.

Is there a way to ensure that the image shows in both the WYSIWYG editor and front end?

---

<div class="post-metadata">

**Author:** ![pauloamgomes](https://yyz2.discourse-cdn.com/flex030/user_avatar/discourse.getcockpit.com/pauloamgomes/32/48_2.png) [@pauloamgomes](https://discourse.getcockpit.com/u/pauloamgomes)\
**Post date:** [May 18, 2019, 12:41pm UTC](https://discourse.getcockpit.com/t/relative-asset-urls-arent-working-as-expected/835/2 "2019-05-18T12:41:36Z")

</div>

Hey @jasonday, my answer will not help on the WYWIWYG question but will be more a suggestion on not use that field for handling images. I would use instead the Layout field and build my own cockpit components (Formatted text, Image, Video, etc…) and therefore the page structures are cleaner and can be easily mapped in the frontend to components (e.g. React or Vue components). So when building a page you can insert as you want:

```nohighlight
Heading
FormattedText
Image
FormattedText
SubHeading
Image
FormattedText
Video
...

```

That will result in only one field with a components array so you can implement on your FE the corresponding components using the same name, you can see that in action in [https://github.com/pauloamgomes/CockpitCMS-React-Static](https://github.com/pauloamgomes/CockpitCMS-React-Static)

---

<div class="post-metadata">

**Author:** ![jasonday](https://avatars.discourse-cdn.com/v4/letter/j/67e7ee/32.png) [@jasonday](https://discourse.getcockpit.com/u/jasonday)\
**Post date:** [May 20, 2019, 5:36pm UTC](https://discourse.getcockpit.com/t/relative-asset-urls-arent-working-as-expected/835/3 "2019-05-20T17:36:55Z")

</div>

Thanks Paulo,

I can appreciate the perspective of requiring more structured content, however I think this remains an issue/bug in Cockpit, as it limits the capabilities and flexibility (in installation, user experience, etc.)

---

<div class="post-metadata">

**Author:** ![pauloamgomes](https://yyz2.discourse-cdn.com/flex030/user_avatar/discourse.getcockpit.com/pauloamgomes/32/48_2.png) [@pauloamgomes](https://discourse.getcockpit.com/u/pauloamgomes)\
**Post date:** [May 20, 2019, 7:56pm UTC](https://discourse.getcockpit.com/t/relative-asset-urls-arent-working-as-expected/835/4 "2019-05-20T19:56:27Z")

</div>

That’s true @jasonday, as said my answer was not on solving the issue.
