Paths in JS and CSS files

3 replies · opened Dec 6, 2020

GgorkemdurDec 6, 2020

Hi,

It would be better to include file paths (eg. image paths) relative to root instead of relative to file. I mean instead of including them as images/x.png , it would be better to include as **/**images/x.png.

In my case, I created custom urls using .htaccess so a url like https://dilekita.com/icin-gidilir/tum-aktiviteler which redirects to a php file. However, the functions.js file includes plugin files as js/ so it trys to include plugin files as https://dilekita.com/icin-gidilir/js/xxx.js . The proper way should be including them as **/**js/ so it will look up the file in the root of website as https://dilekita.com/js/xxx.js.

Actually, I gave an example but it applies to all js and css files where any file path included.

Hope, I make it clear. :)

SSemicolon WebSTAFFDec 6, 2020

Hello,

Thank You so much for the Suggestions. We will definitely try integrating this in the Future Versions of Canvas.

Meanwhile, for the JS, we already have settings available for this: http://docs.semicolonweb.com/docs/getting-started/javascript/#docs-options .

Simply set the Custom JS Path in your HTML File using this variable: window.scwJsPath.

This will ensure that the JS Loads from the Appropriate Location. Hope this Helps!

Let us know if we can help you with anything else or if you find any further issues.

GgorkemdurDec 7, 2020

Thx for it.

I saw that parameter but my suggestions is more comprehensive not limited to my sample. Sometimes some images are included in the JS files and they also need to be defined in a similar way. I came across another sample in my first implementations when I bought your template so I do not remember exact file but it was about including an image in a JS file.

As a result, thx for consideration in your future versions.

PS: forget about CSS files as they need to be relative to file, I guess.

SSemicolon WebSTAFFDec 7, 2020

Hello,

Thanks again for more valuable insights on this. We will definitely look into and test more and try including them in the Future Versions of Canvas. We will keep you in the loop.

Meanwhile, do let us know if we can help you with anything else or if you find any further issues with Canvas.

Have the same question, or something new?

Sign in to the Canvas dashboard to reply or open your own topic. Canvas owners get direct help from the SemiColonWeb team.

Reply on the dashboard