[solved] {content_image} tag issue
Posted: Wed Jan 14, 2009 2:28 am
Hi there!
I really like the new CMSMS version, very slick. After installing it for the first time I encountered an Image and a Thumbnail drop down menus in the default page content entry (the blocks are directly under the Parent selection block). After muddling around I discovered these fields can be called by the {content_image} tag. I inserted {content_image block='image'} into my template to see what would happen. No luck so I tried {content_image block='image' dir='images'}, still no luck. Looking at the source I could see it inserting an image but it was only calling the image name in the src. Opening the addon I found dir isn't called in the function, I added:
and changed:
to:
My page displays the image in the Image field just great! BUT, in my muddling, my content edit page is now looking for a second image field of the same name - under my content entry blocks I have a second Image selection block. This is disruptive because now to use {content_image block='image' dir='images'} I have to make sure BOTH fields are filed in with the same image.
If I leave dir undefined in my template my edit page shows an error in the second image select reading:
I could just make a new image block name but since the first image field is present regardless if I use {content_image} I'd like to make use of it (and avoid confusing my client). I can ignore the error but my client will not and I can't deliver the site like that.
So what I think is happening is when I tried {content_image block='image' dir='images'} it wrote to the database like there was a second image block but they both use the same name and interfere with each other. To compound the issue I can only interact with the DB through shell and I don't have a way to visually browse the DB (like w/ phpMyAdmin). Any ideas on how to get rid of this?
Thanks much!
Alane
I really like the new CMSMS version, very slick. After installing it for the first time I encountered an Image and a Thumbnail drop down menus in the default page content entry (the blocks are directly under the Parent selection block). After muddling around I discovered these fields can be called by the {content_image} tag. I inserted {content_image block='image'} into my template to see what would happen. No luck so I tried {content_image block='image' dir='images'}, still no luck. Looking at the source I could see it inserting an image but it was only calling the image name in the src. Opening the addon I found dir isn't called in the function, I added:
Code: Select all
$dir = 'images';
if( isset($params['dir']) ) $dir = $params['dir'];
Code: Select all
$out = '<img src="'.$img.'" ';
Code: Select all
$out = '<img src="uploads/'.$dir.'/'.$img.'" ';
If I leave dir undefined in my template my edit page shows an error in the second image select reading:
Removing the tag from my template causes the second Image field to disappear.Image:
Error retrieving file list
I could just make a new image block name but since the first image field is present regardless if I use {content_image} I'd like to make use of it (and avoid confusing my client). I can ignore the error but my client will not and I can't deliver the site like that.
So what I think is happening is when I tried {content_image block='image' dir='images'} it wrote to the database like there was a second image block but they both use the same name and interfere with each other. To compound the issue I can only interact with the DB through shell and I don't have a way to visually browse the DB (like w/ phpMyAdmin). Any ideas on how to get rid of this?
Thanks much!
Alane