ich hab die Aufgabe für eine Seite eine Art Infobox zu erstellen. Siehe attachment.
Ich hab das eigentlich schon gelöst, nur ich halte meine Lösung für etwas zu gefrickelt. Ich habe 2 Tags erstellt, beide beinhalten HTML-Div's und inline Stylesheets. Der Erste "openbox" und der Zweite "closebox" bilden die Klammer für den Content.
Aufgerufen wird es so:
Code: Select all
{openbox width="100" height="100" title="der titel"} Etwas Inhalt {closebox}
Code: Select all
<?php
function smarty_cms_function_openbox($params, &$smarty)
{
if (isset ($params['width']) && isset ($params['title']) ) {
$title = $params['title'];
$width = $params['width'];
if (!isset ($params['height']) ) {
$height = 150;
}else {
$height = $params['height'];
}
$echostring = '<div class="openboxcontainer" style="position:relative;width:'.($width+5).'px; height:'.($height+5).'px; margin: 15px 15px 15px 0;">
<div style="position:absolute;top:5px;left:5px;width:'.$width.'px; height:'.$height.'px;background-color:#acc0cd;" ></div>
<div style="position:absolute;padding:0 0 0 15px; align: left; border:1px solid #83a7b2;width:'.($width-15).'px; height:'.$height.'px;background-color:#fef5fd;">
<div style="color:#4c7180;margin-left:-15px;padding:0 0 0 15px; width:'.($width-17).'px;line-height: 30px;font-weight:bold;min-height:30px;border: 1px solid #fef5fd;background-color:#e5e2eb;" >'.$title.'</div>';
return $echostring;
}else {
return;
}
}
function smarty_cms_help_function_openbox() {
echo lang('help_function_openbox');
}
function smarty_cms_about_function_openbox() {
}
?>
Code: Select all
<?php
function smarty_cms_function_closebox($params, &$smarty)
{
$echostring = '</div></div>';
return $echostring;
}
function smarty_cms_help_function_closebox() {
echo lang('help_function_closebox');
}
function smarty_cms_about_function_closebox() {
}
?>
Gruß
leerraum