[solved] {content_image} tag issue

The place to talk about things that are related to CMS Made simple, but don't fit anywhere else.
Post Reply
curlypinky
Forum Members
Forum Members
Posts: 109
Joined: Thu Sep 04, 2008 3:49 am

[solved] {content_image} tag issue

Post by curlypinky »

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:

 

Code: Select all

$dir = 'images';
  if( isset($params['dir']) ) $dir = $params['dir'];
and changed:

Code: Select all

$out = '<img src="'.$img.'" ';
to:

Code: Select all

$out = '<img src="uploads/'.$dir.'/'.$img.'" ';
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:
Image:
Error retrieving file list
Removing the tag from my template causes the second Image field to disappear.

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
Last edited by curlypinky on Fri Jan 16, 2009 11:48 pm, edited 1 time in total.
User avatar
Dr.CSS
Moderator
Moderator
Posts: 12711
Joined: Thu Mar 09, 2006 5:32 am

Re: {content_image} tag issue

Post by Dr.CSS »

For the drop down Image and Thumb in content edit page look here for ways to use it...

http://mit-computers.com/index.php/how- ... types.html

As for content_image no clue just look in the Tags Help for how to...
curlypinky
Forum Members
Forum Members
Posts: 109
Joined: Thu Sep 04, 2008 3:49 am

Re: {content_image} tag issue

Post by curlypinky »

Hi Mark,

Great thanks, your tutorial helped! {page_image} didn't seem to work for me but {$content_obj->GetPropertyValue('image')}  works great.

Alane
Post Reply

Return to “The Lounge”