Show
Ignore:
Timestamp:
08/04/05 20:08:05 (3 years ago)
Author:
bergius
Message:

Made header background image configurable

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/src/templates/layout-kubrick.xml

    r8323 r8324  
    193193        <pid>9f78a8384a425feb0cfb22d9461f5a71</pid> 
    194194</blobs> 
    195  
    196 <element id="4f4cfd5e84e49950a70cf6585cce7dcd" changed="20050804193526"> 
     195<element id="1faadab39aa15b73e0a31aa13df15fc8" changed="20050804195925"> 
     196        <value><![CDATA["default" => array ( 
     197 
     198    "name"        => "default", 
     199    "description" => "Kubrick layout configuration", 
     200    "fields"      => array ( 
     201        "header_background" => array ( 
     202            "description" => "Header background image", 
     203            "helptext"    => "Big image, at minimum 760 pixels wide", 
     204            "datatype"    => "image", 
     205            "location"    => "attachment", 
     206            "widget_image_simple" => true, 
     207            "datatype_image_thumbwidth" => 760, 
     208            "datatype_image_thumbheight" => 4000, // Don't limit this so width will rule 
     209            "start_fieldgroup" => array(), 
     210            "end_fieldgroup"   => "", 
     211        ), 
     212    ), 
     213),]]></value> 
     214        <style>9f78a8384a425feb0cfb22d9461f5a71</style> 
     215        <name><![CDATA[__schema]]></name> 
     216</element> 
     217 
     218<element id="4f4cfd5e84e49950a70cf6585cce7dcd" changed="20050804200318"> 
    197219        <value><![CDATA[<?php 
    198220if (   $_MIDGARD['self'] != $GLOBALS["midcom_site"]["uri"] 
     
    237259                /* END IMAGE CSS */ 
    238260                 
    239  
    240                 /*      To ease the insertion of a personal header image, I have done it in such a way, 
    241                         that you simply drop in an image called 'personalheader.jpg' into your /images/ 
    242                         directory. Dimensions should be at least 760px x 200px. Anything above that will 
    243                         get cropped off of the image. */ 
    244                  
    245                 /*#headerimg    { background: url('&(midcom_site["uri"]);/images/personalheader.jpg') no-repeat top;}*/ 
     261                <?php 
     262                // Check if user has defined other settings 
     263                $style = mgd_get_style($_MIDGARD["style"]); 
     264                if ($style)  
     265                { 
     266                    // Customize header 
     267                    $atts = $style->listattachments(); 
     268                    if ($atts) 
     269                    { 
     270                        while ($atts->fetch()) 
     271                        { 
     272                            if ($atts->parameter("midcom.helper.datamanager.datatype.blob","fieldname") == "header_background") 
     273                            { 
     274                                $guid = $atts->guid(); 
     275                 
     276                                // Use thumbnail instead if available 
     277                                $thumbguid = $atts->parameter("midcom.helper.datamanager.datatype.image","thumbguid"); 
     278                                if ($thumbguid) { 
     279                                    $guid = $thumbguid; 
     280                                } 
     281 
     282                                echo "#headerimg        { background: url('{$GLOBALS['midcom_site']['uri']}midcom-serveattachmentguid-{$guid}/{$atts->name}'); }"; 
     283                                break; 
     284                            } 
     285                        } 
     286                    } 
     287                } 
     288                ?> 
    246289        </style> 
    247290         
     
    380423<div id="footer"> 
    381424        <p> 
    382                 &(midcom_site["site_title"]); is proudly powered by  
     425                <a href="&(midcom_site["uri"]);" title="&(midcom_site["site_title"]);">&(midcom_site["site_title"]);</a> is proudly powered by  
    383426                <a href="http://www.midgard-project.org/">Midgard CMS <?php echo mgd_version(); ?></a>. 
    384427                <!-- 
     
    645688        <pid>9f78a8384a425feb0cfb22d9461f5a71</pid> 
    646689</blobs> 
    647 <element id="d83e96647714a5621b6abbc1f3c891e4" changed="20050804193842"> 
     690<element id="d83e96647714a5621b6abbc1f3c891e4" changed="20050804195240"> 
    648691        <value><![CDATA[/*    
    649692        Kubrick v1.2.5  for  WordPress 1.2 
     
    12541297        } 
    12551298 
    1256 #midcom_helper_datamanager_field_content { 
     1299div.narrowcolumn input.shorttext, div.narrowcolumn #midcom_helper_datamanager_field_content { 
    12571300        width: 400px; 
    12581301        } 
     1302div.narrowcolumn pre { 
     1303        width: 400px; 
     1304        overflow: auto; 
     1305        } 
     1306#content form.datamanager div.form_toolbar input { 
     1307        border: 1px solid #147; 
     1308        -moz-border-radius: 4px;     
     1309        background-color: #147; 
     1310        color: #ffffff; 
     1311        } 
     1312#content form.datamanager div.form_toolbar input:hover { 
     1313        background-color: #06c; 
     1314        } 
     1315 
    12591316 
    12601317