Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Relative path vs full path for images and PDF links
#31
Well, it doesn't work for me (or I'm too stupid to understand it).
I did these modifications to fileprowser.php as suggested on the other thread:

$sitepath = suggest_site_path(true);
$fullPath = $sitepath . "/data/uploads/";

This gives me a truncated path that is not relative to the GS installation but still includes the subfolder where GS is installed on my local system (which will not work when the site is moved to the production site). It looks like:

/localSubfolder/data/uploads/

So instead I could set:

$fullPath = "/data/uploads/";

to get a site-relative path and add something like:

<base href="<?php get_site_url(); ?>" />

to the head of all my templates (this is how ModX solves the problem).

The only remaining problem is, that the Editor doesn't show the images if I use this kind of link and I don't fully understand why, otherwise I would maybe be able to solve it myself. If the Editor could be made to use site-relative paths too, all would be working I think.

I don't follow the "there is nothing broken" argument, since I think GS has the opportunity to offer something that most other CMS don't: perfect Site portability. Since it uses no database, it already is superior in this area, and only this one bit is missing to make it totally perfect: A drag and drop Website that works after one initial quick setup between multiple sites, something I'm sure not only I would love.

If I miss something, I'm really sorry and would love to learn what that is.
The solution above keeps the content free of tokens and works perfect in ModX.

Cheers and thanks for any further hints,

Tom
Reply


Messages In This Thread
RE: Relative path vs full path for images and PDF links - by Thomas Helzle - 2013-08-20, 02:55:12



Users browsing this thread: 2 Guest(s)