之前的 "另类的模块标题右侧加"更多"链接" 一文, 方法比较简陋. 到J1.0.12的话,也要改系统文件, 所以就产生了这种方法.
乘新年之际写出来送给大家。祝大家在新的一年里一切顺意,心想事成!
1, 在mod_latestnews.xml里结尾处的
</params>
上行加
<param name="diymore" type="text" size="60" default="" label="DIY More URL" description="DIY More URL by Autoit!" />
2, 将mod_latestnews.php里的
<ul class="latestnews<?php echo $moduleclass_sfx; ?>">
替换为:
<?php if ($module->showtitle == 0) {?>
<h3><?php if ($diymore !="") echo '<a href="'.$diymore.'">More...</a>' ?><?php echo $module->title ; ?></h3>
<?php }?>
<ul class="latestnews<?php echo $moduleclass_sfx; ?>">在
$nullDate = $database->getNullDate();
下面增加下面一行:
$diymore = trim( $params->get( 'diymore' ) );
3,在你使用的模板里 template_css.css 的最后增加:
div.module h3 a, div.moduletable h3 a {
float:right;
text-decoration:none;
color:#1B57B1;
padding-right:20px;
}如果你模板还是 table 的话,可能还要把上面的 div.module h3 a, div.moduletable h3 a 改变为: div.module h3 a, div.moduletable h3 a, table.moduletable th a
Ok , end !
使用注意:
1,如果要显示more的话, 模块设置里的 Show title [显示标题] 选 否[No]
2,如果你这个模块设置里有使用 Module Class Suffix 的话,上面第三步要的css名字要做适当调整,假如你在后台Module Class Suffix设置为 -blank , 那么上面css的名称地方应该就是 div.module-blank h3 a, div.moduletable-blank h3 a
其实其他任何想加 more 的都可以这样做的。。。By Autoit!
Only registered users can write comments.
Please login or register.