If you want to have a nice backend preview of the uploaded images in your CMS Made Simple news entries, you need to do the following:
1. Create a new Field Definition named “Image” and type File in News Module:
2. Create a new folder structure in your CMSMS root directory called “module_custom/News/templates” like this:
3. Copy “editarticle.tpl” from modules/News/templates over to our new templates folder.
4. Find this code:
[php]
{if isset($custom_fields)}
{foreach from=$custom_fields item=’field’}
<div class="pageoverflow">{$field->prompt} {$field->field}</div>
{/foreach}
{/if}
[/php]
And replace it with this one:
[php]
{if isset($custom_fields)}
{foreach from=$custom_fields item=’field’}
{$field->prompt}{$field->field}
{if $field->prompt == "Image"}
{if $smarty.get.m1_articleid}<br/><img width="100" src="../uploads/news/id{$smarty.get.m1_articleid}/{$field->field|replace:" <input":"\"/><!–"} –>
{/if}
{/if}
{/foreach}
{/if}
[/php]
Now, the uploaded image will be displayed in a small size below the upload field!
This concludes how to add a backend preview thumbnail for your image fields in your CMS Made Simple news modules.
Looking for quality CMS Made Simple Hosting? Look no further than Arvixe Web Hosting!