Adding partials from UI returns wrong path

I have links relative to site root.

My partial is in /views/partials/folder/ and the content page calling the partial is in /views/folder/folder/folder/

If I add the partial to the content page via UI it will add this to code

<%- await include('partials/folder/partial, Object.assign({}, locals, )) %>

Which will end up in browser error.
I have change it manually to the following so it works.

<%- await include('../../../partials/folder/partial', Object.assign({}, locals, )) %>

I just ran into this same issue. I have

Pages\layouts (layout.ejs)
Pages\partials (_nav.ejs, _footer.ejs)

While editing my layout.ejs page I simply select “partials/_nav” and “partials/_footer” from the dropdowns. That is NOT correct. It results in the code await include('partials/_nav', Object.assign({}, locals, )) and messes it up. I have to add ../ to get it to work.

This is improved in Wappler 3.4.0 now

An absolute link to /partials is always used - so no matter where your partial is located it works.

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