Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
image not displayed
#1
hello, just installed getsimple.
after i wrote the right path in the code, (../data/uploads/041.jpg) and the image was displayed in my page, (see iamge) i could not see it back 'live'. nor by clicking View , nor by visiting my site. (http://www.jeelsites.nl/GetSimple_2.01/)
how can?


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

later ive found that i needed to fill in the WHOLE path:
http://www.jeelsites.nl/GetSimple_2.01/d...ds/041.jpg
why is that? why cant i put a relative path?
Reply
#2
jeel2008 Wrote:Why is that? Why cant I put a relative path?
You can use a relative path, no problem, but ../data/uploads/041.jpg is not the correct relative path. “../” points to a step higher in the hierarchy of the file structure. So if you use that path on http://www.jeelsites.nl/GetSimple_2.01/ it will work like this:
Code:
http://www.jeelsites.nl/GetSimple_2.01/../data/uploads/041.jpg => http://www.jeelsites.nl/data/uploads/041.jpg
The reason it works in the page editor is because you’re at a different location then and the browser will do this:
Code:
http://www.jeelsites.nl/GetSimple_2.01/admin/../data/uploads/041.jpg => http://www.jeelsites.nl/GetSimple_2.01/data/uploads/041.jpg
Hope this explained your problem.
“Don’t forget the important ˚ (not °) on the a,” says the Unicode lover.
Help us test a key change for the core! ¶ Problems with GetSimple? Be sure to enable debug mode!
Reply
#3
Zegnåt Wrote:
jeel2008 Wrote:Why is that? Why cant I put a relative path?
You can use a relative path, no problem, but ../data/uploads/041.jpg is not the correct relative path. “../” points to a step higher in the hierarchy of the file structure. So if you use that path on http://www.jeelsites.nl/GetSimple_2.01/ it will work like this:
Code:
http://www.jeelsites.nl/GetSimple_2.01/../data/uploads/041.jpg => http://www.jeelsites.nl/data/uploads/041.jpg
The reason it works in the page editor is because you’re at a different location then and the browser will do this:
Code:
http://www.jeelsites.nl/GetSimple_2.01/admin/../data/uploads/041.jpg => http://www.jeelsites.nl/GetSimple_2.01/data/uploads/041.jpg
Hope this explained your problem.
hello zegnat, and thanks for your help.
but...one step higher in the file structure, indeed. i thought it would be right. see image.
so, what would be the correct relative path than, seeing this image? (above getsimple is only httpdocs, thats the main file.
Reply
#4
The only fail-safe relative path is a path relative to the domain: “/GetSimple_2.01/data/uploads/041.jpg”. Starting with a forward slash means this path will be followed starting from the domain’s root.

The problem with relative paths is that you have to think about how visitors are going to see your page in their browser. Thinks about this: Unless you know exactly how a page is going to be requested by the visitors browser it’s impossible to use “../” in your relative path. You’re stuck with either a path relative to the domain or the exact path.
“Don’t forget the important ˚ (not °) on the a,” says the Unicode lover.
Help us test a key change for the core! ¶ Problems with GetSimple? Be sure to enable debug mode!
Reply
#5
Zegnåt Wrote:The only fail-safe relative path is a path relative to the domain: “/GetSimple_2.01/data/uploads/041.jpg”. Starting with a forward slash means this path will be followed starting from the domain’s root.

The problem with relative paths is that you have to think about how visitors are going to see your page in their browser. Thinks about this: Unless you know exactly how a page is going to be requested by the visitors browser it’s impossible to use “../” in your relative path. You’re stuck with either a path relative to the domain or the exact path.

ok thanks, im going to try figure out what you're saying.
Reply
#6
I'm trying to figure this out also. I've been using another (more complex) CMS but am developing a more simple site with GetSimple right now.

If we have www.sample.com (as the Website Base URL, domain is forwarded to whatever folder on the web server where the files are stored...no folders in the web address), then sub page may be www.sample.com/subpage. And further could be www.sample.com/subpage/subsubpage.

BUT...when I'm building the site, I'm using www.mydomain.com/customer/site/ (as the Website Base URL...developing on my own server).

So, when I'm developing the site, I need to specify images as /customer/site/data/uploads/image1.jpg, but when I go live I need to go back through and change every image to /data/uploads/image1.jpg. Can't GetSimple use the Website Base URL as the starting / when you specify an image path? Rather than assuming it is the root of the domain...which it probably only is once the site is live.

That's how the CMS I've been using works, so when I update the domain from testing to live, I'm good to go. I just change the Website Base URL.

Am I missing something? (I know I could be...probably am.)

I do like GetSimple otherwise...it's nice to just log in to a simple CMS and do what I need. Not lots of extra stuff.

THANKS!

(PS. Am I not allowed to use quotes in my post? :-) I did and it truncated my post at the first quote.)
Reply
#7
eric@rosewood Wrote:Can’t GetSimple use the Website Base URL as the starting / when you specify an image path? Rather than assuming it is the root of the domain… which it probably only is once the site is live.
Well, GetSimple doesn’t assume anything at all. The web browser interprets an URL starting with a forward slash to be a path relative to the domain, because this is how it is defined by some agency (W3C? IETF?).

GetSimple touches as little of your HTML as possible, because you’re not forced to use a visual editor and can just as well be writing plain HTML for your pages every time. It would annoy people who did that to let GetSimple mess with their content.

You could however develop a plugin that looks through your content and replaces all URLs starting with a forward slash to contain the base URL. Adding a filter to the content that does a quck search and replace should be very possible.

eric@rosewood Wrote:Am I not allowed to use quotes in my post? :-) I did and it truncated my post at the first quote.
Everyone should be allowed to quote. Some combination of characters (or some browser setting) seems to randomly truncate posts. Some people have noticed a problem like that, some haven’t. Best thing to do is to just try again.
“Don’t forget the important ˚ (not °) on the a,” says the Unicode lover.
Help us test a key change for the core! ¶ Problems with GetSimple? Be sure to enable debug mode!
Reply
#8
Interesting thread... good point. Moving a site can be painful if there are many images in pages contents.

I can think of another simple way to do this (preferably from the beginning).

Go to settings. Don't use fancy permalinks, but:
- default URL schema (URL would be "SITE/index.php?id=page")
Or if you installed 2.02, you can use one of these:
- Custom permalink (mod_rewrite enabled): %slug% ("SITE/page")
- Custom permalink: ?id=%slug% ("SITE/?id=page")

(You see, no parent in URL.)

Now link your images with one of these relative paths:
“data/uploads/041.jpg”
or:
“./data/uploads/041.jpg”

I've only tested on localhost, but I think it should work... Even images are correctly displayed inline in the page editor.

Note: Not only images, you can also link your site's pages with relative URLs (<a href="page">) (Edit: <-- this would be for custom permalink %slug%)
Reply




Users browsing this thread: 1 Guest(s)