Relative paths - images

Help with getting the CMS CORE package up and running. This does not include 3rd party modules, PHP scripts, anything downloaded via module manager or from any external source.
Locked
redcrew

Relative paths - images

Post by redcrew »

I'm new to CMSMS and trying to finish setting up a test page from an existing static site.

The stylesheet in the existing static site has images located in the images folder, for example, www.mysite.com/images.

I've added the {metatag} to the head of the template.
Checked the config.php file for the location of images, and am not understanding what changes need to be made so the stylesheet can continue to have images defined in the images folder. Here's what is currently in the config.php file for images:

$config['image_uploads_path'] = '/home/thesite/public_html/clients/test/uploads/images';
$config['image_uploads_url'] = $config['root_url'] . '/uploads/images';

I don't want to list the image folder in the stylesheet as uploads/images.

In the wiki, I found the following information:
Add the {metadata} plugin call to the section of your templates. This will automatically insert the base href tag to your site's root so that relative paths to files and images function as expected.
What changes do I need to make? I checked the forums, and found a reference to relative paths and images, but didn't find a solution. I'm likely missing something very obvious.
alby

Re: Relative paths - images

Post by alby »

redcrew wrote: I'm new to CMSMS and trying to finish setting up a test page from an existing static site.

The stylesheet in the existing static site has images located in the images folder, for example, www.mysite.com/images.

I've added the {metatag} to the head of the template.
Checked the config.php file for the location of images, and am not understanding what changes need to be made so the stylesheet can continue to have images defined in the images folder. Here's what is currently in the config.php file for images:

$config['image_uploads_path'] = '/home/thesite/public_html/clients/test/uploads/images';
$config['image_uploads_url'] = $config['root_url'] . '/uploads/images';

I don't want to list the image folder in the stylesheet as uploads/images.

In the wiki, I found the following information:
Add the {metadata} plugin call to the section of your templates. This will automatically insert the base href tag to your site's root so that relative paths to files and images function as expected.
??? uploads/images is the relative path
/home/thesite/public_html/clients/test/uploads/images  is the pabsolute path

Alby
redcrew

Re: Relative paths - images

Post by redcrew »

Thanks for the response.
Guess I'm not explaining the situation well. Perhaps I shouldn't have added the comment about relative path in the question.

What I want is the ability to identify the location of images in the stylesheet and throughout the content as images/myimage.gif.

How do I do that?

I've looked at other sites that use CMSMS, and have seen the image location identified in two different ways:
1. images/myimage.gif
2. uploads/images/myimage.gif

I have several sites I"m considering converting to using CMSMS. All of the sites have their stylesheets, and within page images located in the images folder of the root.

I want to continue to refer to the locations of the images in the images folder, not uploads/images folder. I don't want to have update all the content and stylesheets.
alby

Re: Relative paths - images

Post by alby »

redcrew wrote: I've looked at other sites that use CMSMS, and have seen the image location identified in two different ways:
1. images/myimage.gif
2. uploads/images/myimage.gif
Also I have images of layout template in images/ (for use in stylesheet/template only) and upload/images/ for modules / plugins / album / ....
You are free to use them in this way, in root there is a images directory
The problem is that, the access in image/, is possible by ftp only and not Image Manager

Alby
redcrew

Re: Relative paths - images

Post by redcrew »

Thanks for the response.

For clients managing their site, who would be updating through the CMS, their images would then upload in the upload/images area, is that correct?
User avatar
Dr.CSS
Moderator
Moderator
Posts: 12711
Joined: Thu Mar 09, 2006 5:32 am

Re: Relative paths - images

Post by Dr.CSS »

Yes, sorry but your best bet is to set all the CSS to point to uploads/images...

If you get a good editor, like PSPad editor you can copy them from CMSMS and search to replace the lines like url(images/image.jpg)..

The search would be images/ or as some are, ../images/ or www.somesite.com/images/ and the replace would be uploads/images/ with the {metadata} tag in the head this will give a relative path and the <base href= will fill in the rest...
redcrew

Re: Relative paths - images

Post by redcrew »

I'm curious - Why is my best bet to  point to uploads/images?

It's a bit confusing since the video tutorial shows the stylesheet being changed interactively to point to the images folder, not uploads/iimages.
bterkuile
Forum Members
Forum Members
Posts: 97
Joined: Sun Jul 22, 2007 11:48 am

Re: Relative paths - images

Post by bterkuile »

Maybe it is a stupid reply, but I think you can change the config settings  image_uploads_path/url to /path/to/images and $config['root_url'] . '/images';
and make the images folder writable (chmod 777 images)

Does this solve the problem?
redcrew

Re: Relative paths - images

Post by redcrew »

Thanks for the response.  I don't think it's a stupid reply - I was thinking the same thing! But wasn't sure of the best method for managing template images vs. images for a specific page.

I've worked with WordPress before and created stylesheets for WordPress themes. The WordPress setup has images for styling in the images folder of the theme. When referenced in the stylesheet, the rule refers to the images folder for images. For example: background: #fff url(images/wrapper.gif);

Images that are uploaded for a specific page are copied to a different folder, similar to what alby recommended in an earlier response.

I expected to reference images in the stylesheet in a similar manner with CMSMS, which would make the site more portable, if I ever decided to move the site.
User avatar
Dr.CSS
Moderator
Moderator
Posts: 12711
Joined: Thu Mar 09, 2006 5:32 am

Re: Relative paths - images

Post by Dr.CSS »

When you go to Image Manager it is pulling up uploads/images so if you upload they go there, if you go to file manager you will see all that is in uploads including images folder...

If all you want is for ppl. to see only images they can use and not all the images like ones used for templates you can keep your images some place else like you have now...

I keep them in numerous folders inside uploads and uploads/images, just has to do with how you want to use them and the system...
Locked

Return to “[locked] Installation, Setup and Upgrade”