"Image" option in Content Editor - Change directory

The place to talk about things that are related to CMS Made simple, but don't fit anywhere else.
Post Reply
andrew_syd
Forum Members
Forum Members
Posts: 23
Joined: Thu Feb 05, 2009 4:42 am

"Image" option in Content Editor - Change directory

Post by andrew_syd »

Is there any way to change the directory that is used for the "Image" drop-down input in the Content Editor page?

Currently it only lists the images under uploads/images and I would like to change it to something like uploads/images/pages

Thank you.
jasononeil
New Member
New Member
Posts: 3
Joined: Wed Sep 02, 2009 6:05 am

Re: "Image" option in Content Editor - Change directory

Post by jasononeil »

Hey andrew_syd

I was looking to do the same thing today, I assume you're talking about changing the image on a normal page, rather than on a newsletter?

On line 371 of lib/classes/contenttypes/Content.inc.php I found this code:

Code: Select all

	  $dir = $config['image_uploads_path'];
	  $data = $this->GetPropertyValue('image');
I changed it to:

Code: Select all

	  $dir = $config['image_uploads_path'] . "/sidebar";
	  $data = $this->GetPropertyValue('image');
And that worked for me. 

Please note that CMSMS stores these as relative URLs, eg. it will only save "Sidebar01.jpg" not "www.example.com/uploads/images/sidebar/Sidebar01.jpg", so you have to make sure your image is pointing to the right directory.  Ask if you need more help and I can show you what i've done.
Post Reply

Return to “The Lounge”