force image same name

6 posts by 3 authors in: Forums > CMS Builder
Last Post: October 7, 2010   (RSS)

By Maurice - April 14, 2010

Hi IT team

is there a way to force a image in a section always to have the same name even when overwriting the old image???

Greetz Maurice
-------------------------------------------

Dropmonkey.nl

Re: [Maurice] force image same name

By Jason - April 14, 2010

Hi Maurice,

No, there isn't a built in way to handle that. If you can give me an example of the situation where you would need this, we can try to find a solution.

Thanks.
---------------------------------------------------
Jason Sauchuk - Project Manager
interactivetools.com

Hire me! Save time by getting our experts to help with your project.
http://www.interactivetools.com/consulting/

Re: [Jason] force image same name

By Maurice - April 15, 2010

yes we build email templates for email browsers like outlook.

customers can add product banners at the footer and this they can change cause we don't send the image its linked to the cms but if the image name changes than the link is gone and whe have to make a new template.

but i think we are to fast with our ideas hahahaha for cmsb.
hehehehehe
-------------------------------------------

Dropmonkey.nl

Re: [Jason] force image same name

Hi Jason,

As maurice already mentioned; we (also) build HTML email stationery for our clients. Within this stationery we place an image (like a kind of "banner") with a URL behind it. When people click on the "banner" the visitor will go to a website.

This is not that difficult, we can upload new banners with ftp and overwrite the old one.

Now we would like to give our clients the opportunity to upload the new banner by them self with CMS Builder. So we need a upload plugin where we can add a (special) upload field to a section and determine that only one file can be uploaded and that the filename is always the same (it will overwrite the existing image).

Can you please provide me with a quote for this? It would really help us to extend our services.

Thank you

Re: [nkerschgens] force image same name

By Jason - October 7, 2010

Hi,

We could certainly look into creating a custom plugin for you.

You can limit the number of files that can be uploaded to an upload field by editing that field. In this way you can guarantee that there would never be more than one image per record. Then, instead of always having to use the same name, you could create a dynamic url to your image by pulling the information directly from cms builder.
The code would look similar to this:

<?php if($record['image']): ?>
<?php $banner = $record['image'][0];?>
<img src="http://<?php echo $_SERVER['HTTP_HOST'];?><?php echo $image['urlPath'];?>" height="<?php echo $image['height'];?>" width="<?php echo $image['width'];?>" alt="<?php echo $image['info1'];?>" />
<?php endif ?>


Using a method like this, you could dynamically create a path to the image regardless of what it was called. Would this work for you?

If you're still interested in a custom plugin, please send an email to consulting@interactivetools.com with a list of requirements and we can make a quote for you.

Hope this helps.
---------------------------------------------------
Jason Sauchuk - Project Manager
interactivetools.com

Hire me! Save time by getting our experts to help with your project.
http://www.interactivetools.com/consulting/