How do I export clean local image...

User 2374778 Photo


Registered User
12 posts

I have a many local images that I want pointed perfectly at the following absolute folder path. This is the css I need..

background-image: url('images/Icon_test.png')


But site designer always prepends the path with an './' and appends additional 'cache' information
which I don't need. The exported line looks like this:

background-image: url('./images/Icon_test.png?id=61&cache=1701459929410')


To manual go through and adjust paths all the time will take forever. Is there a way to force it to use an absolute path without any changes?
Thanks

Simon
User 2699991 Photo


Registered User
5,077 posts
Online Now

Simon Keating wrote:
I have a many local images that I want pointed perfectly at the following absolute folder path. This is the css I need..

background-image: url('images/Icon_test.png')


But site designer always prepends the path with an './' and appends additional 'cache' information
which I don't need. The exported line looks like this:

background-image: url('./images/Icon_test.png?id=61&cache=1701459929410')


To manual go through and adjust paths all the time will take forever. Is there a way to force it to use an absolute path without any changes?
Thanks

Simon


does it work ? (as in shows the images when pre-viewed)

the ./ is required to point to the relevant folder in your resources

Mastering The Understanding With Hands-On Learning
NEW TO "COFFEECUP SITE DESIGNER" FOUNDATION 6 FRAMEWORK?
STUCK ON SOMETHING?

LEARNING & UNDERSTANDING "THE HOW TO"? THE WHY'S & THE WHEREFORE'S?
WITH WAYAN'S STEP BY STEP TUTORIALS
Contact Me For One To One Assistance
https://mawarputih.coffeecup.com/forms/contact-wayan/

A simple quick way to contact me
https://rsd-tutorialscom.coffeecup.com/ … l-details/
User 2699991 Photo


Registered User
5,077 posts
Online Now

Alternatively you need to export all your images to your server separately from SD project
then you can set the links in SD to the relevant image to absolute (https://your-domain.xxx/folder-name/image-name.xxx)
Mastering The Understanding With Hands-On Learning
NEW TO "COFFEECUP SITE DESIGNER" FOUNDATION 6 FRAMEWORK?
STUCK ON SOMETHING?

LEARNING & UNDERSTANDING "THE HOW TO"? THE WHY'S & THE WHEREFORE'S?
WITH WAYAN'S STEP BY STEP TUTORIALS
Contact Me For One To One Assistance
https://mawarputih.coffeecup.com/forms/contact-wayan/

A simple quick way to contact me
https://rsd-tutorialscom.coffeecup.com/ … l-details/
User 379556 Photo


Registered User
1,558 posts

Simon Keating wrote:
... To manual go through and adjust paths all the time will take forever. Is there a way to force it to use an absolute path without any changes?...

One doesn't need to adjust the paths to remove the cache reference. I have just tested the matter and found the following.

When using 'Preview on ...' the source code's main.css file for the background image did indeed show

background-image: url('../img/palace.JPG?id=34&cache=1701499885975');

When exported rather than just previewed the source code's main.css file for the background image showed

background-image: url('../img/palace.JPG');

It would, I think, be necessary to adjust the paths for an absolute rather than a relative path, and Wayan shows how to do this,

Frank
User 2374778 Photo


Registered User
12 posts

Thanks. I am actually hoping to use Site Designer to create a game user interface and so Im copying the element html and css manually using the the right click option and then directly pasting it into my own codebase.

If I use the export option it exports lots of unrequired folders and files that I don't really need (js), even then the export option prepends '../' to the local images whereas I would want want nothing prepended nor appended.

Additionally, using the export option (as opposed to the right click>export html) the html is bloated with Jquery and other things that are just not needed.!?!

It sounds like there is very minimal options for export (which is a real shame because Site Designer seems to do a lot right) and no way to change this default export behaviour in site designer so I may have to look at modifying the css at runtime from my own code or use another system.

If there IS ever another update could I ask for customization to the local file paths on export?

Thanks :)
User 379556 Photo


Registered User
1,558 posts

Simon Keating wrote:
... could I ask for customization to the local file paths on export? ...

Since these forums are primarily for users helping each other, I think it would be best to post the request in the Site Designer Suggestions section ( https://www.coffeecup.com/forums/site-d … ggestions/ ), perhaps including a link back to your post to explain the background to your request.

The CoffeeCup team are may well not see suggestions made in other sections.

Frank
User 2374778 Photo


Registered User
12 posts

It turns out the best way to do this is using the Right click>View Element Code option.

This version of the css contains no irrelevant suffixes for the local files.


Have something to add? We’d love to hear it!
You must have an account to participate. Please Sign In Here, then join the conversation.