"content_image" directory path when default "uploads" not used [Solved]

For questions and problems with the CMS core. This board is NOT for any 3rd party modules, addons, PHP scripts or anything NOT distributed with the CMS made simple package itself.
Post Reply
User avatar
lunarpig
Forum Members
Forum Members
Posts: 11
Joined: Thu Nov 12, 2009 10:56 pm

"content_image" directory path when default "uploads" not used [Solved]

Post by lunarpig »

Hi. I'm running CMS Made Simple 1.8.2. I'm using PHP 5.2.11, and MySQL 5.0.77. This is all working with Apache Apache/2.2.3 (CentOS) on Linux.

In my config.php file, I typically change the default "uploads" folder to "media". Unfortunately, I'm having an issue when trying to use the "content_image" tag when not using the default "uploads" directory.

Although the system retrieves the list of images in my folder correctly in the page editor, it always renders on the page using the default "uploads" prefix.

Code: Select all

{content_image block='Page Photo' dir='images/photos'}
I've tried several variations of the path, and have even tried to update the "function.content_image.php" file directly, but to no avail. I've also searched the forums and couldn't find a solution.

Any help or advice would be greatly appreciated!
Last edited by lunarpig on Wed Sep 15, 2010 4:19 pm, edited 1 time in total.
alexbuckland

Re: "content_image" directory path when default "uploads" not used in config.php

Post by alexbuckland »

The dir is relative to the uploads folder so the easiest way to do it to copy your "media" folder into uploads then the dir path would be

Code: Select all

dir='media/images/photos'
Hope that helps
User avatar
lunarpig
Forum Members
Forum Members
Posts: 11
Joined: Thu Nov 12, 2009 10:56 pm

Re: "content_image" directory path when default "uploads" not used in config.php

Post by lunarpig »

Thanks for your input, Alex. Copying files over would definitely work, but unfortunately that it isn't a solution to provide to a client.

All media (images, documents, video, etc.) needs to be placed in a more meaningful location for URL posting purposes, which is why we're using "media" instead of "uploads".

As an alternative, I'm using a basic content tag for them to use to place the image file. Still, it would be best if the content_image tag worked with the config.php file correctly.
alexbuckland

Re: "content_image" directory path when default "uploads" not used in config.php

Post by alexbuckland »

Have you tried putting something like dir='../media/images/photos'

Or maybe its just a bug in your version of php, maybe try upgrading to 5.2.12?
Are you getting any specific errors in your debug window?
User avatar
lunarpig
Forum Members
Forum Members
Posts: 11
Joined: Thu Nov 12, 2009 10:56 pm

Re: "content_image" directory path when default "uploads" not used in config.php

Post by lunarpig »

Alex,

Adding the '../media/' worked. I thought I had tried that option, but apparently I didn't. Thanks for pointing that out and the time addressing my issue...much appreciated.
alexbuckland

Re: "content_image" directory path when default "uploads" not used [Solved]

Post by alexbuckland »

Your welcome
Post Reply

Return to “CMSMS Core”