2

I am using ExpressionEngine 2.5.2 and I'm having trouble getting my ed_imageresizer to work on my second site, setup through Multisite Manager. ed_imageresizer is installed and working on my primary site, however, when I try to use it on my second site, I see broken images where the resized image should be. In my system's config.php file, I have the paths to my first site setup correctly (these are paths located on my local environment):

$config['ed_server_path'] = '/Users/cplaptop/Sites/site1/html/';
$config['ed_cache_path'] = '/Users/cplaptop/Sites/site1/html/images/resizer_cache/'; 

In my template, I am including the ed_imageresizer code to find the image:

{exp:ed_imageresizer
image="{image}"
maxWidth="400"
cropratio="400:225"
quality="100" 
alt="Portfolio Artwork"}

I tried swapping out those paths just to test if they are directing anything to the second site like this (which didn't work):

$config['ed_server_path'] = '/Users/cplaptop/Sites/site2/html/';
$config['ed_cache_path'] = '/Users/cplaptop/Sites/site2/html/images/resizer_cache/'; 

When I try directing the plugin to the second site, in my browser I no longer see broken images, I just don't see anything at all.

I have also tried the suggestion found here to create a conditional in my config.php, but I haven't been able to get that to work. When I try using conditionals, here is the code that I'm using in my config.php:

$host = $_SERVER[‘HTTP_HOST’];
if($host == ‘domain.com’ or $host == ‘www.domain.com’) {
$config[‘ed_server_path’] = ‘/Users/cplaptop/Sites/site1/html/’; // Server path to        your site’s web root
$config[‘ed_cache_path’] = ‘/Users/cplaptop/Sites/site1/html/images/resizer_cache/’; // Server path to where your resized images should be stored
}

$host = $_SERVER[‘HTTP_HOST’];
if($host == ‘domain.com’ or $host == ‘www.domain.com’) {
$config[‘ed_server_path’] = ‘/Users/cplaptop/Sites/site2/html/’; // Server path to        your site’s web root
$config[‘ed_cache_path’] = ‘/Users/cplaptop/Sites/site2/html/images/resizer_cache/’; // Server path to where your resized images should be stored
}

Am I missing anything here? When I try this route, neither my primary or secondary sites show images. I'm willing to try any way that works, so all suggestions are appreciated!

  • what does the template debugger tell you? Most likely, I would remove the config variables from the config.php and into the index.php for each site respectively and using assign_to_config global vars instead. – Steven Grant Jan 29 '13 at 21:47
  • Hey Steven - how do I find the template debugger? – jennetcetera Jan 29 '13 at 23:16
  • You can set $config['template_debugging'] = "y"; in config.php and then add debug param to your {exp:ed_imageresizer} tag – Steven Grant Jan 30 '13 at 7:50
  • Can you upgrade EE? I had an issue like this with MSM using CE Image and an EE upgrade fixed it. I'm sorry I can't recall more detail. – Christy Collins Jan 31 '13 at 4:55
0

what does the template debugger tell you? Most likely, I would remove the config variables from the config.php and into the index.php for each site respectively and using assign_to_config global vars instead.

| improve this answer | |
  • thanks for the help! I moved the $config[‘ed_server_path’] & $config[‘ed_cache_path’] into the individual sites' index.php file. then I changed them to $assign_to_config['ed_server_path'] & $assign_to_config['ed_cache_path'] and added their respective paths. – jennetcetera Mar 20 '13 at 13:59
3

I had trouble like this with ed_image when I first starting using 2.x. I found CE Image to be far better and easier to work with. It's fairly easy to convert to CE Image too.

| improve this answer | |
  • ah yes, but ED Image Resizer is free ;) – jennetcetera Mar 19 '13 at 17:19
1

I came across a similar problem with ed_imageresizer and MSM. I wanted to be able to use ed_imageresizer on both MSM sites but ran into problems with the server paths. I solved the problem by installing two versions of the ed_imageresizer plugin and using one version for each site, with different path configurations stored in each plugin.

I used ed_imageresizer for site1 and kai_imageresizer for site2. You can find kai_imageresizer on this devot-ee.com forums thread: http://devot-ee.com/add-ons/support/ed-imageresizer/viewthread/460#8479

Kai_imageresizer is a forked version of ed_imageresizer that allows resizing of remote images. You don't need the remote image function for resizing images for site2, but you can use this plugin so you can have two versions of ed_imageresizer installed, each with different server and cache paths.

| improve this answer | |
  • this solution sounds like it will work for now, however, what would i do if i added a third site? – jennetcetera Mar 19 '13 at 16:26

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.