WebsiteBaker Community Forum

General Community => Global WebsiteBaker 2.8.x discussion => Topic started by: crnogorac081 on November 10, 2009, 03:40:30 PM

Title: Change url to droplet code
Post by: crnogorac081 on November 10, 2009, 03:40:30 PM
Hi,

Just came up to this idea while I was moving from one to another server.

For example when you move site from server A to server B, I noticed that pictures (and maybe some other content) doesnt work, as their url is stored in database like www.serverA/media/image1.jpg   and I had to manualy overwrite all paths to www.serverB

So my idea is to use a droplet when you add a picture from wysiwyg or others module, to replace www.serverA.xy/ with [[WB_URL]] or something like that - droplet :)  So when you preview source code in wysiwyg to see link as [[WB_URL]]/media/picture1.jpg 

what do you think ?

cheers
Title: Re: Change url to droplet code
Post by: maverik on November 10, 2009, 03:48:48 PM
i think thats a task for fck editor, maybe it can be modified to set the wb url by inserting images
Title: Re: Change url to droplet code
Post by: pcwacht on November 10, 2009, 04:29:58 PM
Content can be changed with a droplet

Simply scan the content for www.serverA and replace with www.serverB

BTW
You should allways use relative links (../pictureurl/picture.gif) , not absolute (http://www.server.com/pictureurl/picture.gif) .

Have fun.
John
Title: Re: Change url to droplet code
Post by: crnogorac081 on November 10, 2009, 10:54:12 PM
yes, but when you call a picture from a wysiwyg you get absolute link.. :)
Title: Re: Change url to droplet code
Post by: sare on November 11, 2009, 08:32:15 AM
Right, fck editor hands out absolute urls, which is slightly annoying.

I've always dealt with it by search-replacing the absolute urls in the MySQL dump when publishing a site...
Title: Re: Change url to droplet code
Post by: Vincent on November 11, 2009, 11:11:45 AM
Indeed this is one of the most annoying issues of WB!
Don't know if this issue is addressed earlier, but maybe we should make a ticket of it?

Vincent
Title: Re: Change url to droplet code
Post by: LordDarkman on November 11, 2009, 11:17:39 AM
Maybe? I made one :wink:
I thing this would be a gread Feuture!

CU Moritz
Title: Re: Change url to droplet code
Post by: pcwacht on November 11, 2009, 11:21:12 AM
Problem lies in the WB_PATH and WB_URL, these are needed for when a website resides in a subdir, ie
www.domain.nl/somedir/

You could manual change:
/modules/fckeditor/fckeditor/editor/filemanager/connectors/php/config.php

Line 52
$Config['UserFilesPath'] = WB_URL .MEDIA_DIRECTORY ;

to
$Config['UserFilesPath'] = MEDIA_DIRECTORY ;

If a subdir is used change it to:
$Config['UserFilesPath'] = '/somedir' .MEDIA_DIRECTORY ;

I tried and it worked at my end. xampp on windows xp
Worked with pictures and file-links


If it works with you lot, maybe add it to the created ticket to get /somedir in a variable like WB_URL, maybe WB_PATH or WB_ROOT or something.
This can be used in FCK and Xinha and TinyMCE to make them userconfigurable
Maybe add it as a setting in the backend so changes could be on the fly.



Have fun,
John
Title: Re: Change url to droplet code
Post by: pcwacht on November 11, 2009, 11:23:35 AM
PS

This needs thorough testing because of the homefolders feature!!

Title: Re: Change url to droplet code
Post by: crnogorac081 on November 13, 2009, 01:30:37 PM
Right, fck editor hands out absolute urls, which is slightly annoying.

I've always dealt with it by search-replacing the absolute urls in the MySQL dump when publishing a site...

Yes, and this is exactly why I started this thread and wanted to hear your comments.. :)