Using Pathologic with TinyMCE, FCK, YUIEditor - The url "relative to root" , "/" problem

pramudya81 - August 22, 2008 - 10:47
Project:Pathologic
Version:5.x-1.1-beta7
Component:Code
Category:feature request
Priority:normal
Assigned:Garrett Albright
Status:active
Description

My case:
I am using TinyMCE to post content.
I have RSS Feed for my users.
I am using 3rd party i.e. FeedBurner
And all images links broken, they become http://feedproxy.google.com/files/u2/test.jpg instead of http://www.dakiunta.com/files/u2/test.jpg

FeedBurner says this is due to relative path. But having relative path is always preferable compared to absolute one.

So I come accross this module and have great expectation on this module.
However Pathologic treats my img link as absolute urls due to "/" in effect of TinyMCE.
TinyMCE always treats image upload like this which unfortunately considered absolute path by Pathologic.

Can Pathologic solves this issue?

Regards

#1

Garrett Albright - August 22, 2008 - 15:19
Category:support request» feature request
Assigned to:Anonymous» Garrett Albright

But having relative path is always preferable compared to absolute one.

No, not always. As you're seeing, when it comes to feeds, relative paths are useless since they're separated from your site - there's no way for a feed reader to know what a relative path is relative to. Pathologic always outputs absolute paths.

However Pathologic treats my img link as absolute urls due to "/" in effect of TinyMCE.

Arg. So many people are having this problem. I guess I underestimated the number of serious Drupal users who use it.

It looks like what I might have to do is make treatment of paths that start with / as absolute an optional feature, but enabled by default. That way TinyMCE users aren't tripped up by it so much.

Has anyone tried Pathologic with FCKEditor? Does it have the same problem?

#2

pramudya81 - August 22, 2008 - 16:19

Good idea.. make it an optional would make Pathologic more flexible.

Regards

#3

Garrett Albright - August 30, 2008 - 04:48

Okay, so I started work on adding a check box to handle paths that began with a slash, and got pretty far along before I realized -- it's probably not even necessary…

TinyMCE users of the world, could you try this and let me know if it works? In the "Additional paths to be considered local" field, enter just a single slash. Or, if your Drupal installation is in a subdirectory like http://example.com/drupal/, enter "/drupal/" (with both the beginning and ending slashes). I bet that will be enough to kick Pathologic into action on paths that TinyMCE is creating.

#4

pramudya81 - August 31, 2008 - 06:38

Garrett,

Thanks for your work on Pathologic updates here... I would like to try it Pathologic with TinyMCE. But Im still on D5 so could you please update version pathologic-5.x-1.1-beta7.tar.gz too?

Regards

#5

Garrett Albright - September 1, 2008 - 05:24

I don't really support the D5 version, but if you download the dev release (in red on the module page), its features are somewhat comparable to the D6 version.

#6

himerus - September 2, 2008 - 04:58

BINGO!!!

That works perfectly, and I'm using FCKeditor... converted the link perfectly...

#7

juliendorra - September 6, 2008 - 09:47
Title:Using Pathologic with TinyMCE» Using Pathologic with TinyMCE - The url "relative to root" , "/" problem

Thanks for the solution Garrett, I stumbled upon it by chance just before installing Pathologic !

Could it be set as default ?

It would avoid new user of Pathologic to have that kind of trouble

(And I suppose that if you use Pathologic anyway, it's because you want all your links to be fully absolute one, so...)

#8

juliendorra - September 6, 2008 - 09:48
Title:Using Pathologic with TinyMCE - The url "relative to root" , "/" problem» Using Pathologic with TinyMCE, FCK, YUIEditor - The url "relative to root" , "/" problem

#9

Garrett Albright - September 8, 2008 - 00:43

I'll take it into consideration.

#10

HansBKK - October 10, 2008 - 01:43

I personally always use "site relative absolute" paths so I don't have to worry about:

where the link ends up being in the path structure (as I would with true relative paths)

nor

the server.domain name of the server currently hosting the page

This preference has come from static html/css development experience, and I've only just started researching this issue in relation to Drupal. This research led me to this module and of course this issue - sorry if there's a more appropriate place I should post this.

Any relevant advice (not only regarding this module) would be appreciated.

#11

pjsquared - January 27, 2009 - 18:05

I have the situation where I developed locally on /localhost/drupal/

All my src and hrefs have the form /drupal/....

I implemented remotely on /public_html/drupal/ and the root is domain.com

I have to remove the /drupal/ forom all my hrefs on the live site to get it to work

Is there a way of either:

a) removing the /drupal/ on the local site and using pathologic (geat name) to insert the /dupal/ so that the live site would be without it and thus a bit more effiicient, or

b) leaving the /drupal/ in the local site and using pathologic to get rid of it on the live site.

I tried dummying up a link locally and using : /, /drupal/, and /drupal in the Additional paths to be considered local. No luck. Images were not found

thanks for any help

#12

Garrett Albright - January 27, 2009 - 22:11

From what I understand, your remote site is at something like domain.com/drupal/, right? If so, why do you have to remove the /drupal/ from your links?

#13

pjsquared - January 28, 2009 - 14:31

I am very new to this. When I first created the site, it needed to have domain.com/drupal/ to access the home page. If the domain was used, I got this:
______________________________________________________________________________
Index of /
Name Last modified Size Description
--------------------------------------------------------------------------------
Parent Directory 24-Jan-2009 18:13 -
Release.zip 24-Jan-2009 13:13 12.4M
cgi-bin/ 29-Dec-2008 11:51 -
drupal/ 24-Jan-2009 14:37 -
peter/ 24-Jan-2009 09:14 -
transfer/ 24-Jan-2009 12:51 -
xdrupal/ 24-Jan-2009 12:55 -

--------------------------------------------------------------------------------

Apache/1.3.41 Server at peterphrastus.com Port 80

_____________________________________________________________

They said this:

As per your request we have modified your document root
...../public_html to ..../public_html/drupal. Now yourdomain is pointing to drupal page. Since we have modified the document root, all the files and folders should become under ' ..../public_html/drupal'

The site is in fact under this directory but all my links prefixed with /drupal/ were then broken.

Now I'm lost in never land. Maybe I'm trying to use a sledghammer to fix a simple problem.

Sorry for the long diatribe.

#14

Garrett Albright - January 28, 2009 - 16:15

Okay, I see. The web path doesn't have /drupal but the filepath does.

You're using Drupal 6, right? I'm not sure if the version 5 version of this module works correctly for this feature…

So for the paths that don't work, do they include the http://domain.com/ part at the beginning? If so, try entering http://domain.com/drupal/ in the "Additional paths to be considered local" field.

#15

pjsquared - January 28, 2009 - 20:00

Hi Garrett

First, many thanks for your help. I am using 6.9.
This is what the paths are now:

src="/drupal/sites/default/files/HHS/mainsystem.png"

If I were to make them full paths like this on my development Windows box:

src="/http://localhost/drupal/sites/default/files/HHS/mainsystem.png"

and put http://localhost/drupal/ in the additional paths field,

would Pathologic zap this addiotional bit thus ending up with the equivalent of:

src="/sites/default/files/HHS/mainsystem.png"

in the live site environment?

#16

pjsquared - January 29, 2009 - 20:31

I tried out the above scenario and it works perfectly. Thanks for this module. So, for local sites, full paths are the best. Then for live sites 'patholgic' is the best.

#17

Garrett Albright - January 30, 2009 - 03:43

Yes, sorry for the slow reply, but you've found a way to feed Pathologic paths it can work with. Thanks for trying Pathologic!

#18

maynardsmith - February 28, 2009 - 13:47

Re. the discussion at #3 above, I have the following scenario, and configuration which (I think after half an hour) works.

I have a development site at example.com/dev/ and a live site at example.com/live/.

I am using Drupal 6, with FCKEditor. I am also using ImageBrowser to insert inline images in the text, which creates URLs such as src="/dev/sites/default/files/imagecache/small/images/xxx.jpg"

I want my users to be able to put in links to external sites and internal pages using the FCKEditor toolbar "link" button. I would prefer not to get into the confusion between "node/28" and "/node/28" so would like both to convert correctly.

The following pathologic configuration seems to work:

/dev/
/live/
/

(The single slash must be at the end or imagebrowser URLs end up as /dev/dev/...)

Looking good so far,
Tony

 
 

Drupal is a registered trademark of Dries Buytaert.