Seite 1 von 1

Modul FooterboxenLayout

Verfasst: Fr 23. Okt 2009, 13:21
von zimboo
Hallo Community,

ich habe ein kleines Modul gebastelt, in dem Benutzer die Anzahl und größe von Footerboxen auswählen kann. Das Design läßt sich wunderbar per CSS steuern...

Ich möchte es Euch hier einmal vorstellen:

INPUT: (kommte ohne PHP aus ;-) )

Code: Alles auswählen

?>
<table "cellspacing="0" cellpadding="3">
    <tr>
        <td class="text">Bestimmen Sie hier wieviel Boxen am Seitenende angezeigt werden sollen.</td>
        <td class="text">&nbsp;</td>
    </tr>
    <tr>
        <td class="text">Layout mit drei Boxen (1 kleine, 2 große Boxen)<br />
        <img src="cms/upload/boxen_backgrounds/bsp_drei_footerboxen.jpg"></td>
        <td class="text"><input type="radio" name="CMS_VAR[1]" value="3">&nbsp;dreier Set</td>
    </tr>
        <td class="text">Layout mit vier Boxen (1 kleine, 3 mittelgroße Boxen)<br />
        <img src="cms/upload/boxen_backgrounds/bsp_vier_footerboxen.jpg"></td>
        <td class="text"><input type="radio" name="CMS_VAR[1]" value="4">&nbsp;vierer Set</td>    
    <tr>
    </tr>
</table>
<?php    


OUTPUT:

Code: Alles auswählen

<?php
$boxen_layout = "CMS_VALUE[1]";

if($boxen_layout == 3)
{
?> 
    <div id="footer_box_left_klein">
        <div class="box_header">
            <?php
            	if (!isset($tpl) || !is_object($tpl))
            	{
    				$tpl = new Template();
				}
				
				$sText = "CMS_HTMLHEAD[7]";

				$tpl->reset();
				if ($contenido && $edit)
				{
				    $tpl->set('s', 'text', $sText);
				    $tpl->generate('templates/headline_h1.html');
				} 
				else
				{
				    if ($sText != '')
				    {
				        $tpl->set('s', 'text', strip_tags($sText));
				        $tpl->generate('templates/box_headline_1.html');
				    }
				}
           ?>            
        </div>
        <div class="footer_box_klein_text">
        	<?php
            if (!isset($tpl) || !is_object($tpl)) 
            {
    			$tpl = new Template();
			}

			$tpl->reset();
			$tpl->set('s', 'text', "CMS_HTML[13]");
			$tpl->generate('templates/fb_text_html.html');
			?>
        </div>
    </div>
    
    <div id="footer_box_center_gross">
        <div class="box_header">
            <?php
            	if (!isset($tpl) || !is_object($tpl))
            	{
    				$tpl = new Template();
				}
				
				$sText = "CMS_HTMLHEAD[8]";

				$tpl->reset();
				if ($contenido && $edit)
				{
				    $tpl->set('s', 'text', $sText);
				    $tpl->generate('templates/headline_h1.html');
				} 
				else
				{
				    if ($sText != '')
				    {
				        $tpl->set('s', 'text', strip_tags($sText));
				        $tpl->generate('templates/box_headline_1.html');
				    }
				}
           ?>                      
        </div>
        <div class="fb_gross_content">
        	<?php
            if (!isset($tpl) || !is_object($tpl)) 
            {
    			$tpl = new Template();
			}

			$tpl->reset();
			$tpl->set('s', 'text', "CMS_HTML[14]");
			$tpl->generate('templates/fb_text_html.html');
			?>            
        </div>
        <div class="fb_box_gross_schaltflaeche">
        	<?php
            if (!isset($tpl) || !is_object($tpl)) 
            {
    			$tpl = new Template();
			}

			$tpl->reset();
			$tpl->set('s', 'text', "CMS_HTML[15]");
			$tpl->generate('templates/fb_text_html.html');
			?>            
        </div>
    </div>
    
    <div id="footer_box_right_gross">
        <div class="box_header">
            <?php
            	if (!isset($tpl) || !is_object($tpl))
            	{
    				$tpl = new Template();
				}
				
				$sText = "CMS_HTMLHEAD[9]";

				$tpl->reset();
				if ($contenido && $edit)
				{
				    $tpl->set('s', 'text', $sText);
				    $tpl->generate('templates/headline_h1.html');
				} 
				else
				{
				    if ($sText != '')
				    {
				        $tpl->set('s', 'text', strip_tags($sText));
				        $tpl->generate('templates/box_headline_1.html');
				    }
				}
           ?>                    
        </div>
        <div class="fb_gross_content">
        	<?php
            if (!isset($tpl) || !is_object($tpl)) 
            {
    			$tpl = new Template();
			}

			$tpl->reset();
			$tpl->set('s', 'text', "CMS_HTML[16]");
			$tpl->generate('templates/fb_text_html.html');
			?>            
        </div>
        <div class="fb_box_gross_schaltflaeche">
        	<?php
            if (!isset($tpl) || !is_object($tpl)) 
            {
    			$tpl = new Template();
			}

			$tpl->reset();
			$tpl->set('s', 'text', "CMS_HTML[17]");
			$tpl->generate('templates/fb_text_html.html');
			?>            
        </div>
    </div>
<?php
}
else if($boxen_layout == 4)  
{
?>
    <div id="footer_box_left_klein">
        <div class="box_header">
            <?php
            	if (!isset($tpl) || !is_object($tpl))
            	{
    				$tpl = new Template();
				}
				
				$sText = "CMS_HTMLHEAD[10]";

				$tpl->reset();
				if ($contenido && $edit)
				{
				    $tpl->set('s', 'text', $sText);
				    $tpl->generate('templates/headline_h1.html');
				} 
				else
				{
				    if ($sText != '')
				    {
				        $tpl->set('s', 'text', strip_tags($sText));
				        $tpl->generate('templates/box_headline_1.html');
				    }
				}
           ?>                     
        </div>
        <div class="footer_box_klein_text">
        	<?php
            if (!isset($tpl) || !is_object($tpl)) 
            {
    			$tpl = new Template();
			}

			$tpl->reset();
			$tpl->set('s', 'text', "CMS_HTML[18]");
			$tpl->generate('templates/fb_text_html.html');
			?>            
        </div>
    </div>
       
    <div id="footer_box_medium_left">
        <div class="box_header">
            <?php
            	if (!isset($tpl) || !is_object($tpl))
            	{
    				$tpl = new Template();
				}
				
				$sText = "CMS_HTMLHEAD[11]";

				$tpl->reset();
				if ($contenido && $edit)
				{
				    $tpl->set('s', 'text', $sText);
				    $tpl->generate('templates/headline_h1.html');
				} 
				else
				{
				    if ($sText != '')
				    {
				        $tpl->set('s', 'text', strip_tags($sText));
				        $tpl->generate('templates/box_headline_1.html');
				    }
				}
           ?>                        
        </div>  
        <div class="footer_box_medium_content">
        	<?php
            if (!isset($tpl) || !is_object($tpl)) 
            {
    			$tpl = new Template();
			}

			$tpl->reset();
			$tpl->set('s', 'text', "CMS_HTML[19]");
			$tpl->generate('templates/fb_text_html.html');
			?>           
        </div>
        <div class="fb_box_gross_schaltflaeche">
        	<?php
            if (!isset($tpl) || !is_object($tpl)) 
            {
    			$tpl = new Template();
			}

			$tpl->reset();
			$tpl->set('s', 'text', "CMS_HTML[20]");
			$tpl->generate('templates/fb_text_html.html');
			?>            
        </div>
    </div>    
           
    <div id="footer_box_medium_left">
        <div class="box_header">
            <?php
            	if (!isset($tpl) || !is_object($tpl))
            	{
    				$tpl = new Template();
				}
				
				$sText = "CMS_HTMLHEAD[12]";

				$tpl->reset();
				if ($contenido && $edit)
				{
				    $tpl->set('s', 'text', $sText);
				    $tpl->generate('templates/headline_h1.html');
				} 
				else
				{
				    if ($sText != '')
				    {
				        $tpl->set('s', 'text', strip_tags($sText));
				        $tpl->generate('templates/box_headline_1.html');
				    }
				}
           ?>                   
        </div>  
        <div class="footer_box_medium_content">
        	<?php
            if (!isset($tpl) || !is_object($tpl)) 
            {
    			$tpl = new Template();
			}

			$tpl->reset();
			$tpl->set('s', 'text', "CMS_HTML[21]");
			$tpl->generate('templates/fb_text_html.html');
			?>            
        </div>
        <div class="fb_box_gross_schaltflaeche">
                       	<?php
            if (!isset($tpl) || !is_object($tpl)) 
            {
    			$tpl = new Template();
			}

			$tpl->reset();
			$tpl->set('s', 'text', "CMS_HTML[22]");
			$tpl->generate('templates/fb_text_html.html');
			?>
        </div>
    </div>   
           
    <div id="footer_box_medium_right">
        <div class="box_header">
            <?php
            	if (!isset($tpl) || !is_object($tpl))
            	{
    				$tpl = new Template();
				}
				
				$sText = "CMS_HTMLHEAD[13]";

				$tpl->reset();
				if ($contenido && $edit)
				{
				    $tpl->set('s', 'text', $sText);
				    $tpl->generate('templates/headline_h1.html');
				} 
				else
				{
				    if ($sText != '')
				    {
				        $tpl->set('s', 'text', strip_tags($sText));
				        $tpl->generate('templates/box_headline_1.html');
				    }
				}
           ?>            
        </div>  
        <div class="footer_box_medium_content">
        	<?php
            if (!isset($tpl) || !is_object($tpl)) 
            {
    			$tpl = new Template();
			}

			$tpl->reset();
			$tpl->set('s', 'text', "CMS_HTML[23]");
			$tpl->generate('templates/fb_text_html.html');
			?>            
        </div>
        <div class="fb_box_gross_schaltflaeche">
        	<?php
            if (!isset($tpl) || !is_object($tpl)) 
            {
    			$tpl = new Template();
			}

			$tpl->reset();
			$tpl->set('s', 'text', "CMS_HTML[24]");
			$tpl->generate('templates/fb_text_html.html');
			?>           
        </div>
    </div> 
<?php
}
?>   
CSS-Style:

Code: Alles auswählen

div#footer_box_left_klein{
    width:200px;
    height:150px;
	background:#f4f4f4;
    border:#cbcccd solid 1px;
    float:left;
}

div#footer_box_center_klein{
    width:200px;
    height:150px;
	background:#f4f4f4;
    border:#cbcccd solid 1px;
    float:left;
    margin:0px;5px;
}

div#footer_box_right_klein{
    width:200px;
    height:150px;
	background:#f4f4f4;
    margin-right:10px;
    border:#cbcccd solid 1px;
    float:right;
    margin-right:10px;
}

div.footer_box_klein_text{
    width:200px;
    height:120px;
}

div#footer_box_medium_left{
	width:250px;
	height:150px;
	background:#f4f4f4;
	border:#cbcccd solid 1px;
	float:left;
	margin-left:7px;
}

div#footer_box_medium_right{
	width:250px;
	height:150px;
	background:#f4f4f4;
	border:#cbcccd solid 1px;
	float:right;
	margin-right:10px;
}

div.footer_box_medium_content{
	width:245px;
	height:86px;
	padding:5px;
}

div#footer_box_left_gross{
    width:381px;
    height:150px;
	background:#f4f4f4;
    border:#cbcccd solid 1px;
    float:left;
}

div#footer_box_center_gross{
    width:381px;
    height:150px;
	background:#f4f4f4;
    border:#cbcccd solid 1px;
    float:left;
    margin:0px 5px; 
}
Über die Konfiguration kann nun der Benutzer auswählen, ob er drei oder vier Boxen am Seitenende angezeigt bekommen möchte. Da ich in das "Output-Modul" bereits die "Module" für Headline, Text usw. mit eingebunden habe, kann der Benutzer - wie gewohnt - den Inhalt der Boxen über den Editor (TinyMCE oder ähnliches) pflegen...
Die kann er für jeden Artikel tun...

Vielleicht gefällt es ja jemandem...

Greets us Kölle


Jörg