主题:更新一个“旧”的主题

发布者: Burning在 2009/12/24 12:30:00 9319次阅读
从Xoops 2.0.14版本开始,可以在中心列显示底部分块。一些主题没有这个功能,请参阅旧主题专辑

在大多数情况下,更新不是一个复杂的任务。以下是一种更新方法

1 • 复制您的主题文件夹中的模板(从默认主题)
- theme_blockcenter_c
- theme_blockcenter_l
- theme_blockcenter_r
- theme_blockleft.html
- theme_blockright.html


2 • 修改 theme.html

a) HEAD部分

删除(如果我没记错的话,它已经被 <{$xoops_module_header}> 调用了)
<script type="text/javascript">

script>


添加(需要动态调用块模板)

<{
assign var=theme_name value=$xoTheme->folderName}>


b) Body部分

用/default theme.html代码替换旧的canvas代码

        <{if 
$xoops_showlblock}>
            <
td id="leftcolumn">
            <{foreach 
item=block from=$xoBlocks.canvas_left}>
                <{
includeq file="$theme_name/theme_blockleft.html"}>
            <{/foreach}>
            td>
        <{/if}>
        

        <
td id="centercolumn">

        
        <{if 
$xoBlocks.page_topleft or $xoBlocks.page_topcenter or $xoBlocks.page_topright}>
            <
table cellspacing="0">
            <
tr>
                <
td id="centerCcolumn" colspan="2">
                
                <{foreach 
item=block from=$xoBlocks.page_topcenter}>
                    <{
includeq file="$theme_name/theme_blockcenter_c.html"}>
                <{/foreach}>
                
                td>
            tr>
            <
tr>
                <
td id="centerLcolumn">
                
                <{foreach 
item=block from=$xoBlocks.page_topleft}>
                    <{
includeq file="$theme_name/theme_blockcenter_l.html"}>
                <{/foreach}>
                
                td>
                <
td id="centerRcolumn">
                
                <{foreach 
item=block from=$xoBlocks.page_topright}>
                    <{
includeq file="$theme_name/theme_blockcenter_r.html"}>
                <{/foreach}>
                
                td>
            tr>
            table>
        <{/if}>
        

        <
div id="content">
          <{
$xoops_contents}>
        div>

        <{if 
$xoBlocks.page_bottomleft or $xoBlocks.page_bottomright or $xoBlocks.page_bottomcenter}>
        <
table cellspacing="0">
            <{if 
$xoBlocks.page_bottomcenter}>
                <
tr>
                    <
td id="bottomCcolumn" colspan="2">
                        <{foreach 
from=$xoBlocks.page_bottomcenter item=block}>
                            <{include 
file="$theme_name/theme_blockcenter_c.html"}>
                        <{/foreach}>
                    td>
                tr>
                <{/if}>
                <{if 
$xoBlocks.page_bottomleft or $xoBlocks.page_bottomright}>
                <
tr>
                    <
td id="bottomLcolumn">
                        <{foreach 
from=$xoBlocks.page_bottomleft item=block}>
                            <{include 
file="$theme_name/theme_blockcenter_l.html"}>
                        <{/foreach}>
                    td>
                    <
td id="bottomRcolumn">
                        <{foreach 
from=$xoBlocks.page_bottomright item=block}>
                            <{include 
file="$theme_name/theme_blockcenter_r.html"}>
                        <{/foreach}>
                    td>
                tr>
            <{/if}>
        table>
        <{/if}>        
        
      td>

    <{if 
$xoops_showrblock}>
        <
td id="rightcolumn">
        
        <{foreach 
item=block from=$xoBlocks.canvas_right}>
            <{
includeq file="$theme_name/theme_blockright.html"}>
        <{/foreach}>
        
        td>
    <{/if}>



3 • 修改模板

中心块模板获取以下标签(theme_blockcenter_c.html、theme_blockcenter_l.html和theme_blockcenter_r.html)
-
:删除它
- :替换为



4 • 修改样式表

a) 块

复制顶部中心块的样式
td#centerCcolumn {padding: 0px;}
td#centerCcolumn div.blockTitle {padding: 10px 3px 3px 15px; color: #000000; font-weight: bold; margin-top: 0px; margin-right: 0px;  margin-left: 0px;}
td#centerCcolumn div.blockContent {border-bottom: 1px solid #dddddd; padding: 5px 15px; margin-right: 0px; margin-left: 0px; margin-bottom: 3px; line-height: 130%;}

td#centerLcolumn {width: 50%; padding: 0px 3px 0px 0px;}
td#centerLcolumn div.blockTitle {padding: 10px 3px 3px 10px; color: #000000; font-weight: bold; margin-top: 0px;}
td#centerLcolumn div.blockContent {padding: 5px; margin-left: 0px; margin-right: 0px; margin-bottom: 2px; line-height: 120%;}

td#centerRcolumn {width: 50%; padding: 0px 3px 0px 0px;}
td#centerRcolumn div.blockTitle {padding: 10px 3px 3px 10px; color: #000000; font-weight: bold; margin-top: 0px;}
td#centerRcolumn div.blockContent {padding: 5px; margin-left: 0px; margin-right: 0px; margin-bottom: 2px; line-height: 120%;}


将“center”替换为“bottom”,以将相同的样式应用到下方的块。

如下所示
td#bottomCcolumn {padding: 0px;}
td#bottomCcolumn div.blockTitle {padding: 10px 3px 3px 15px; color: #000000; font-weight: bold; margin-top: 0px; margin-right: 0px;  margin-left: 0px;}
td#bottomCcolumn div.blockContent {border-bottom: 1px solid #dddddd; padding: 5px 15px; margin-right: 0px; margin-left: 0px; margin-bottom: 3px; line-height: 130%;}

td#bottomLcolumn {width: 50%; padding: 0px 3px 0px 0px;}
td#bottomLcolumn div.blockTitle {padding: 10px 3px 3px 10px; color: #000000; font-weight: bold; margin-top: 0px;}
td#bottomLcolumn div.blockContent {padding: 5px; margin-left: 0px; margin-right: 0px; margin-bottom: 2px; line-height: 120%;}

td#bottomRcolumn {width: 50%; padding: 0px 3px 0px 0px;}
td#bottomRcolumn div.blockTitle {padding: 10px 3px 3px 10px; color: #000000; font-weight: bold; margin-top: 0px;}
td#bottomRcolumn div.blockContent {padding: 5px; margin-left: 0px; margin-right: 0px; margin-bottom: 2px; line-height: 120%;}


(b)主菜单和用户菜单

要获得漂亮的菜单,请检查 display: block; 指令
引用
引用

#mainmenu a {display: block;}
#usermenu a {display: block;}




如果您更新一个“旧”的主题,其实可以在注释中放一个下载链接