{{indexmenu_n>200}} ===== Images: Rounded corners ===== Forum: [[http://forum.phpwcms.org/viewtopic.php?f=27&p=112420#p112420]] \\ Autor: "claus" ---- \\ Wouldn't it be nice to "make" an image with rounded corners on the fly, only by choosing a template (yes, that simple so everybody now can be a shotophop hero)? Ok, here we go: === Files === * **Copy the following code and save it as ##cornerframed.tmpl## in ##template/inc_cntpart/images/ ##** [TITLE]

{TITLE}

[/TITLE] [SUBTITLE]

{SUBTITLE}

[/SUBTITLE] [TEXT]{TEXT}[/TEXT]
[PHP] $GLOBALS['block']['css']['cornerframed'] = 'specific/cornerframed.css'; $GLOBALS['block']['custom_htmlhead']['cornerframed'] = ' ' [/PHP]
{IMAGE}


\\ * **Copy the following code and save it as "cornerframed.css" in ##template/inc_css/specific/ ##** /* CSS Document */ div.rwrapper { margin:3px; position:relative; float:left; vertical-align:top; } div.rwrapper img{ float:left; border:0 none; } div.rwrapper div{ position:absolute; left:0; height:7px; width:100% } div.rwrapper div.tl{ background:transparent url(/pics/tl.gif) top left no-repeat; top:0 } div.rwrapper div.tr{ background:transparent url(/pics/tr.gif) top right no-repeat; top:0; } div.rwrapper div.bl{ background:transparent url(/pics/bl.gif) bottom left no-repeat; bottom:0 } div.rwrapper div.br{ background:transparent url(/pics/br.gif) bottom right no-repeat; bottom:0; } See how the wrapper.className of the script is corresponding with the div.rwrapper of the CSS. Everything within this wrapper will be "treated", but nothing outside of it. === Images === Now you need to fiddle together some images - 4 exactly. Make your own ones, borrow them from elsewhere or take these (they are not mine, but from the originating site, so please do them on your own, but with these you'll get the idea). I will post some new ones later on (probably ;) ) In this example I have placed them into a folder named "pics", but you can throw them anywhere (but then you'll have to edit the CSS-file accordingly) Download: {{:deutsch:andere-erweiterungen:images.zip|Images}} Now your only task will be to edit one of your articles in backend, add another Content Part "images(div)", select the new template, choose one or many images and off it goes. Happy rounding! All this can be seen in it's original beauty at \\ [[http://sitepoint.com/examples/rounded_images/]] I had to change very few parts of the script to get it going. Very nice! Thank you! Since this is relying on JS the fallback is simple too: just no rounded corners, that's all. Many thanks for your attention :lol: