Urls incorrectly placed with shared folder for assets for subfolders

Issues related to previewing and publishing your web site.
Post Reply
Marct
 
 
Posts: 5
Joined: Sat Mar 07, 2020 3:47 pm

Urls incorrectly placed with shared folder for assets for subfolders

Post by Marct »

Make a master page with Layout Grids project.(It may bug without master page, but I'm using it, so be it).
http://wysiwygwebbuilder.com/master_page.html
http://www.wysiwygwebbuilder.com/suppor ... erpage.zip

Add any local image to master page.

On Tools > Options > HTML
Select "Use shared folder for assets (pages in folder...)"

Images will be parsed relatively to current folder instead of root's master page and won't display.

Version: 15.3.0
User avatar
Pablo
 
Posts: 22489
Joined: Sun Mar 28, 2004 12:00 pm
Location: Europe
Contact:

Re: Urls incorrectly placed with shared folder for assets for subfolders

Post by Pablo »

This is expected behavior. The master page should be in the same folder as pages that are using it.
The HTML of the master page will be instered "AS IS". The HTML will be the same for all pages, so if the master page is in another folder then the paths will not be correct.
Marct
 
 
Posts: 5
Joined: Sat Mar 07, 2020 3:47 pm

Re: Urls incorrectly placed with shared folder for assets for subfolders

Post by Marct »

This is anti-pattern to be the expected behavior, shared folder assets works for the the sole purpose of sub-folder.
It works correctly for main resources(CSS and JS), but incorrectly for other datas.

Any resource in the main page should be treated as CSS and JS resources already are and parsed to the root directory.

I ask you to consider it this way.

Thanks in advance.
User avatar
Pablo
 
Posts: 22489
Joined: Sun Mar 28, 2004 12:00 pm
Location: Europe
Contact:

Re: Urls incorrectly placed with shared folder for assets for subfolders

Post by Pablo »

I'm sorry, this cannot be changed.
The HTML code of a master page is the same for all pages, because the purpose of a master page is to reuse elements.
The code will be inserted "AS IS". So, if you insert the code in a page that is in another folder then the paths will not be correct. Because they are relative to the master page.
Marct
 
 
Posts: 5
Joined: Sat Mar 07, 2020 3:47 pm

Re: Urls incorrectly placed with shared folder for assets for subfolders

Post by Marct »

Pablo wrote: Fri Sep 25, 2020 6:25 am I'm sorry, this cannot be changed.
The HTML code of a master page is the same for all pages, because the purpose of a master page is to reuse element.
The code will be inserted "AS IS". So, if you insert the code in a page that is in another folder then the paths will not be correct. Because they are relative to the master page.
That's exactly why it can be changed, because it's constant.
It's possible to get track of where the master page is and append it to other folders, if you want.

E.G.: Given current state, URL's are exported as "image.png", they could be exported as "/image.png"(which would always point to site's root) so if you find time to add it, it will work by making an option per project where user can set a default prepend url for all his drag and drop links, resulting in:
"user_custom_path/image.png".

I'm pretty sure it's concise and the expected behavior when dealing with WWB interface.

I'm just noting a point which feels unintended(due to nature of shared assets) that will improve the program, which is already a very good Software, for anyone that uses it.

It's a clean design pattern of which without hacks that harm WYSIWYG will work for people who doesn't want redundant resource and tricks to achieve it, post parsing etc and will work on preview exactly as on page editor.

What do you think?
Pablo wrote: Fri Sep 25, 2020 6:25 am The HTML code of a master page is the same for all pages, because the purpose of a master page is to reuse element.
That's exactly my point, I want to reuse element.
If I make 20 sub folders and need to create 20 master pages copy-paste with 20 copy-paste images, then it's defeating the purpose of shared folder assets which exists solely to avoid redundancy on sub-folders.

The thing is, it already works for default CSS and JS the way I'm mentioning, but it's not for other resources, making the option(shared folder assets) inconsistent.
Post Reply