SnippetMaster Support Forums
Return to main website
 
December 18, 2007, 07:24:54 PM
* Show unread posts since last visit.
* Show new replies to your posts.
Welcome, Guest. Please login or register.
Did you miss your activation email?
December 18, 2007, 07:24:54 PM

Login with username, password and session length
Search:  
Advanced search
* Home Help Search Login Register
SnippetMaster Support Forums  |  General  |  General Discussion & Support  |  Topic: Using a symbolic link for images « previous next »
Pages: [1] Print
Author Topic: Using a symbolic link for images  (Read 217 times)
nutts4life

Posts: 4


[-] Using a symbolic link for images
« on: August 20, 2007, 03:20:37 AM »

Hi there,

I understand the issue with paths to images, but could there be a solution by using symbolic links (assuming you are using linux/unix).

If you have a folder under your public_html directory: 'imgs'

So your site images are contained in the folder: /home/username/public_html/imgs

You could put a symbolic link in the %HOME%/snippet/includes/tiny_mce/themes/advanced/images/ directory to your imgs folder.

Then any relative paths like: imgs/my_img.jpg will be displayed?

I haven't tested this yet as i need to ask my hosting provider to do this for me.

My question is, where should the symbolic link go? Is my assumption above correct as putting it in the /tiny_mce directory?

Any help would be great, and may solve alot of peoples problems. (assuming that they can great symbolic links!)

Thanks,

Olly
Report to moderator   Logged
admin
Forum Administrator
*
Posts: 2086

SnippetMaster Author


WWW
[-] Re: Using a symbolic link for images
« Reply #1 on: August 20, 2007, 03:25:24 AM »

If the starting path is set correctly for the User, then relative links should be working...

The editor tries to "resolve" any relative paths it finds in the code that is loaded into the editor automatically.  It does this using a few values that are "passed in" when the editor loads.  If those values are incorrect, then the relative path is messed up.

Using a linked image path will not fix the problem is your web server has an odd configuration/setup that is causing relative paths to not work in the first place.

If relaitve paths are not working for you, can you make sure that the starting path for your User is correct?  If it is correct, let me know and I'll try to take a look and see..

Report to moderator   Logged
nutts4life

Posts: 4


[-] Re: Using a symbolic link for images
« Reply #2 on: August 20, 2007, 05:09:09 AM »

OK,

I guess i should have read the other posts more carefully.

I think i can see the problem now.

My users starting folder is correct but the snippets are contained in a folder called content.

So the user has to move to this dir to edit his/her snippets.

images is on the same level as snippets. So i guess the relative path in the content dir is ../images/image.png.

The content files are loaded dynamiaclly in php from index.php and therefore the path must be images/image.png.

So it looks like this:

[images] - contains images
[content] - content files with snippets
index.php  - includes files and images.

Surely this is a common setup?

how would you propose i get around this problem, with content and images in a seperate folder the relative paths will never work in snnipetmaster. (without a symbolic link to images in the content folder:

[images] - contains images
[content] - content files with snippets
     |
      -> [images] symbolic link to images above.
index.php  - includes files and images.

Am i way off the mark here?

O
Report to moderator   Logged
admin
Forum Administrator
*
Posts: 2086

SnippetMaster Author


WWW
[-] Re: Using a symbolic link for images
« Reply #3 on: August 20, 2007, 08:50:58 AM »

To be honest, I'm not sure I'm following you here.  If you're using a php include to call the content, then Snippetmaster (or any other editor) has no frame of reference for the included file. 

So Snippetmaster will not be able to "figure out" the path to the relative links in the html file.

What you might want to try is using absolute links instead.  That will certainly fix the problem...

The only possible other solution might be to try a symbolic link...  since the relative path will be "../images/image.png" (inside the content folder), you could try creating a link inside the content folder called "images", which is mapped to the real images folder.  (Just like your diagram in your post shows.)

That might work.  Let me know...

Smile

(Also to answer your question... no, it's not really a common setup to do things like this.  Well.. it is.. but not for the people who are using SnippetMaster.  It is designed to be a very simple HTML editor. It is not designed to work with complicated setup and configuration like using PHP include files that need to have relative links.  That's something that a LOT of programming would still have trouble trying to make work correctly.)


Report to moderator   Logged
nutts4life

Posts: 4


[-] Re: Using a symbolic link for images
« Reply #4 on: August 21, 2007, 07:30:57 AM »

I tried creating a sybolic link in the content driectory to images and to my style.css and this did not work.

But you may be able to help further here. I realise that snippetmaster is desgined for small sites.

But i'm surprised that this design of mine is not used more often. Snippet master does ovver absolute links but the aiblity to actaully point to your imges directory and css would be great in the admin area.

The reason i say this is that under my present design i have a fully extensible design. I have a single template index.php in my base directory and then the data on the site is updated according to a php get:
/index.php/page=home. will include a home.html file as an include from the content directory.

I think that Snippetmaster is limiting itself by expectiing designers to repeat their template for each page. OR put all their includes in one directory (the base directory).
which i'm now very tempted to do.

A great addition to Snippetmaster would be the ability to define where you css file is and where images are stored.
I understand thought that this may not be possible using tiny_mce as it is out of the box.

Anyway, just a thought......

Olly
Report to moderator   Logged
admin
Forum Administrator
*
Posts: 2086

SnippetMaster Author


WWW
[-] Re: Using a symbolic link for images
« Reply #5 on: August 21, 2007, 03:41:17 PM »

Hi Olly,

The purpose of Snippetmaster is for basic HTML webpage editing.  There are lots of websites that fit this description... 

At this time, I have no plans to make SnippetMaster any more complicated, and I do not believe the "return on my investment" of the time needed to reprogram the software to handle your type of setup would bring very much additional $$. 

Smile


Report to moderator   Logged
admin
Forum Administrator
*
Posts: 2086

SnippetMaster Author


WWW
[-] Re: Using a symbolic link for images
« Reply #6 on: August 21, 2007, 03:43:46 PM »

I guess I should be a little more clear...

There are literally hundreds of different ways you can organize a website, and even more if you are using PHP to handle the page redirects or content using "includes", etc.

The method you are using is common, but not enough that it would attract very many people to Snippetmaster.  Most people who are able to set up the type of system you are using, are not interested in something like Snippetmaster.  Thus, I don't believe it's worth the *incredible* amount of programming time that would be necessary to make Snippetmaster work with the hundreds of different method of "calling" page files and content.

Snippetmaster is a simple editor for simple websites.  It's easy to install, simple to set up, and works very well for its purpose.  I do not want to make it "over-complicated".

Cheers!

Report to moderator   Logged
Pages: [1] Print 
SnippetMaster Support Forums  |  General  |  General Discussion & Support  |  Topic: Using a symbolic link for images « previous next »
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.3 | SMF © 2006-2007, Simple Machines LLC Valid XHTML 1.0! Valid CSS!