Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Relative path vs full path for images and PDF links
#36
Ok, so ATM I found the following solution, I have to test it more thoroughly tomorrow:

Line 30 in filebrowser.php:

$fullPath = "data/uploads/";

No leading slash! This way it works in the Editor - images are visible.

And in the header of my templates:

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

Which includes the full installation path, so it works in subfolders as well as on the rootlevel.

I didn't have to change anything else, the important difference here was the removal of the leading slash in the fullpath variable, which originally wasn't there, but in shawns example it was, which threw me off. ;-)

It would be great if you guys with more GS experience could come up with some problem-scenarios that could break this.

Since absolute links still work as well, I guess it's rather failsafe?

One problem I found already is, that all plugins seem to have their own version of the browser, therefore it would have to be changed in each plugin too (after that it works there as well, I tried i18n custom fields).
I read somewhere that there are plans to solve this at the root, so that plugins don't have to rebuild the browser?

In that case, the changes to GS would be trivial. There could be an option in gsconfig which would change the $fullpath to GS-Installation relative as above and include the base href in the headers.

Plugin authors could mirror that until it can be solved at the root.

Would be great if it were so simple in the end :-)

Cheers,

Tom
Reply


Messages In This Thread
RE: Relative path vs full path for images and PDF links - by Thomas Helzle - 2013-08-20, 09:11:21



Users browsing this thread: 2 Guest(s)