Images within partials do not render in editor

Wappler Version : 3.7.4
Operating System : mac
Server Model: node
Database Type:
Hosting Type: custom

Expected behavior

An image within a partial, should render properly in the editor and in the browser

Actual behavior

Images only render properly in the browser

How to reproduce

In the editor, an error is received that the image is not found, however in the browser the image renders properly.

I think it is necessary to set your links relative to site root. Try /assets/img/…

First screenshot.

Ya, that takes care of it.

I omitted a piece of this – the partial was created by the editor from a layout page.

In the layout page, the image selection sets:

assets/img/apple-icon.png (works both in the browser when attached to a content page, and in the editor)

And if you select the same image in a partial it sets:

../assets/img/apple-icon.png (works both in the browser and in the editor)

HOWEVER if you convert a section of content in a layout that includes an image, the original path (assets/img/apple-icon.png) works only in the browser and not the editor.

In other words, the partial should properly set the path, if it is in fact supposed to be different than when used in the layout.

Ken, what’s the paths relative to option set to in your site settings?

The default, Document

Well,
as the tutorial says:

so, please set this to site root …

As always, the point is missed here. Since communication takes two, I’ll take half the blame. :slight_smile:

I’m reporting a bug, not asking for a work-around or a solution. I do so in hopes of making the product better…period.

If Site Root is required when using partials, then I consider it a bug that Wappler does not prompt the user to change if not already set. If you feel the novice user will know to search the forum for a post about SPA, in order to learn that the editor allows for invalid settings, that’s up to you guys.

1 Like

Actually having relative links in partials doesn’t make much sense, as partials can be included all over the place in different pages in different sub folders. So where is the relative link to then?

Maybe we should enforce site root relative links in partials always?

This has been fixed in Wappler 3.7.7

This topic was automatically closed after 44 hours. New replies are no longer allowed.