I am glad to see, that the “master-image”-concept finally made it on the list.
As described here ( http://www.oxid-esales.com/forum/showthread.php?t=3616 ) I had started working on this topic (what I will put on a hold now), so I would like to present my views on how this should work as “food for thought” for the OXID developers…
As you can see from the previous picture, I have extended the “master-inage” concept on [B]all [/B]pictures (standard + up to 12 additional), so that there is consistency for all pictures used.
I have also completely revamped the look and internals of the template-part responsible for building the above input structure, which I find less confusing now…
The internals of the template have also been completely restructured: instead of [B]individually[/B] defining each entry (shudder!), I made use of Smartys’ looping capabilities (“section”): the necessary HTML-definitions for each picture entry are moved to an include-file, which is used in the Smarty loop to build all required entries for all pictures…
So the “Template Monster” “article_pictures.tpl” could be successfully tamed, and now looks like this:
[{ assign var="Conf" value=$oViewConf->getConfig() }]
[{if $Conf->getConfigParam( 'blUseMasterImage' )}]
[{ assign var="blUseMasterImage" value=true }]
[{ /if}]
[{assign var="iPicCount" value='iPicCount'}]
[{assign var="pictures" value=$Conf->getConfigParam($iPicCount)}]
[{ if $blUseMasterImage }]
[{assign var="master_pre" value="ARTICLE_PICTURES_MASTER_PRE"|oxmultilangassign }]
[{assign var="break_index" value=$pictures/2-1 }]
[{include file="article_pictures_inc.tpl" edit=$edit pic_type="masterimage" pic_short_type="MASTER" index=""}]
[{ else}]
[{assign var="break_index" value=$pictures/2+1 }]
[{include file="article_pictures_inc.tpl" edit=$edit pic_type="icon" pic_short_type="ICO" index=""}]
[{include file="article_pictures_inc.tpl" edit=$edit pic_type="thumb" pic_short_type="TH" index=""}]
[{ /if}]
[{section name=pictures start=1 loop=$pictures+1}]
[{assign var="index" value=$smarty.section.pictures.index}]
[{include file="article_pictures_inc.tpl" edit=$edit pic_type="pic" pic_short_type="P" index=$index}]
[{if $index==$break_index}]
<tr>
<td></td>
<td class="edittext">
<br>
<input type="submit" class="edittext" name="save" value="[{ oxmultilang ident="ARTICLE_PICTURES_SAVE" }]" onClick="Javascript:document.myedit.fnc.value='save'">
<br>
</td>
</tr>
</table>
</td>
<!-- Beginning of right side -->
<td valign="top" class="edittext" align="left">
<table cellspacing="0" cellpadding="0" border="0">
[{/if}]
[{/section}]
(In case somebody is interested: I would be happy to share this…)
I made the usage of the new concept [B]configurable[/B], so you could still choose to do it the “old hard way”
In that case, the old familiar picture definition mask will be displayed:
(This mask is also created by the new template structure.)
Talking of configurable: the “[B]pictures[/B]” settings in the admin have been added some parameters:
First of all, you can choose, if or if not you want to use the new “master-image”-concept.
After that you find parameters used to define another nifty enhancment: you can “[B]watermark[/B]” your images, by overlaying an image (e.g. your logo) on each article picture to prevent misuse by others.
After that you find the “[B]Recreate article images[/B]” link, which leads to another (imo desparately needed) enhancement: the capabilty to [B]recreate existing[/B] mages, if you choose to redefine picture sizes or use a different “watermark”. (Thanks to the “master-image”-concept this is now possible.)
This is done by an “[B]image_update[/B]r”, which also is capable of converting an [B]existing [/B]picture definition structure to the [B]new [/B]“master image” structure.
I have implemented that as modules, so that I have restricted myself to rebuild the current capaliities with the new concept only (i.e., the addtional picture only have the picture and the zoom)…
But now beeing part of the core, and experienced OXID developers going at it, the “master-image”-concept could be ultimately enhanced to allow an [B]icon[/B], [B]thumb[/B], [B]picture [/B]and [B]zoom[/B] for [B]all [/B]images: the standard image and the (up to 12) additional images (like good old xtCommerce has)…
I believe, that this functionality covers everything you could want from a flexible and easy picture management.
You should not need more, but also not less…
BTW:
When defining the additional configuration parameters, I found out how [B]stunningly [/B]easy that is: [B]just use [/B]your new parameter(name)s (in some predefined way) in the template to manage these parameters, define the necessary language translations, and your done!
No need to add the new fields to the database, no nothing: OXID will do all that for you automatically…
Well done, guys!