|
导航,2级下拉菜单-织梦首页调用栏目及下级栏目
typeid值为8顶级栏目下的子栏目
{dede:channelartlist typeid='8,8'}
<dt><a href="{dede:field name='typeurl'/}">{dede:field name='typename'/}
</a></dt>
{dede:channel type='son' noself='yes'}
<dd><a href="[field:typelink/]">• [field:typename/]</a> </dd>
{/dede:channel}
{/dede:channelartlist}
最新文章
{dede:arclist row=14 titlelen=32 noflag='h'}
<li><a href="[field:arcurl/]">[field:title/]</a></li>
{/dede:arclist}
顶级栏目列表
{dede:channel type='top' row='6' currentstyle="<li class='hover'><a
href='~typelink~' ~rel~><span>~typename~</span></a></li>"}
<li><a href='[field:typeurl/]' [field:rel/]>[field:typename/]
</a></li>
{/dede:channel}
当前栏目列表
{dede:channel type='son' currentstyle="
<li><a href='~typelink~' class='thisclass'>~typename~</a></li>
"}
<li><a href='[field:typeurl/]'>[field:typename/]</a></li>
{/dede:channel}
栏目页获取当前栏目名称:
{dede:type}<a href=" [field:typelink /] "> [field:typename /] </a>
{/dede:type}
当前栏目无链接
{dede:type}[field:typename /]{/dede:type}
文章推荐
{dede:arclist flag='c' titlelen=42 row=6}
<li><a href="[field:arcurl/]">[field:title/]</a>
<p>[field:description function='cn_substr(@me,80)'/]...</p>
</li>
{/dede:arclist}
当前文章的栏目调用
{dede:type}
<a href="[field:typelink /]">[field:typename /]</a>
{/dede:type}
调用分类栏目下的文章
<!--上级栏目-->
{dede:type typeid="9"}
<a href="[field:typelink /]">[field:typename /]</a>
{/dede:type}
<!--栏目文章-->
{dede:arclist titlelen=42 row=6 typeid="9"}
<a href="[field:arcurl/]">[field:title/]</a>
{/dede:arclist}
没链接的
{dede:type}
[field:typename /]
{/dede:type}
图文资讯
{dede:arclist row=5 orderby=pubdate type='image.' imgwidth='124'
imgheight='94'}
<li><a href="[field:arcurl/]">[field:image/]<span class="title">
[field:title/]</span></a></li>
{/dede:arclist}
调用随机图片
{dede:arclist row='5' titlelen='30' sort=’rand’ type='image.' }
<li>
<a rel="nofollow" href='[field:arcurl /]'><img src='[field:litpic/]'
alt='[field:title/]' border='0' width='75' height='75' border="0"></a>
</li>
{/dede:arclist}
带缩略图列表
{dede:list pagesize='10'}
<li> [field:array runphp='yes']@me = (empty(@me['litpic']) ? "" : "<a
href='{@me['arcurl']}' class='preview'><img src='{@me['litpic']}'/></a>");
[/field:array]
[<b>[field:typelink/]</b>] <a href="[field:arcurl/]" class="title">
[field:title/]</a> <span class="info"> <small>日期:</small>[field:pubdate
function="GetDateTimeMK(@me)"/] <small>点击:</small>[field:click/] <small>好
评:</small>[field:scores/] </span>
<p class="intro"> [field:description/]... </p>
</li>
{/dede:list}
列表图片增加alt 更改大小 ,去掉<b>
<img src='{@me['litpic']}' alt='{@me['title']}' width='82' height='82' />
注:顺便为图片加上了宽高属性。
即当文章被推荐时,代码多了一个<b>标签。
修改/include/arc.listview.class.php文件,找到如下代码(v5.6为745行)
$row['title'] = "<b>".$row['title']."</b>";
修改为:$row['title'] = $row['title'];
dede缩略图大小修改
1、{dede:list pagesize='15' imgwidth='100' imgheight='70' infolen='180'}
这里限制图片显示大小。
列表页调用缩略图方法2
2、使用<a href='[field:arcurl /]' target="_blank"><img src='[field:picname
/]' border='0' width='' height=''></a>来调用图片,不去用[field:imglink/],这
样我们可以更好的控制。
使图片不超过最大的尺寸
.img{ max-width:470px;_width:470px;}
头条调用(带图片)
{dede:arclist flag='h' limit='0,1' infolen='230' type='image.' imgwidth='202'
imgheight='152'}
<h2><a href="[field:arcurl/]">[field:image/]</a></h2>
<p>[field:info/]...<a href="[field:arcurl/]">[查看全文]</a></p>
{/dede:arclist}
{dede:arclist flag='h' limit='1,4'}
<div class='d1arc'><a href="[field:arcurl/]">[field:title/]</a></div>
{/dede:arclist}
时间调用标签
[field:pubdate function=MyDate('m-d',@me)/]
[field:pubdate function=MyDate('y-m-d',@me)/]
[field:pubdate function='strftime("%y-%m-%d %H:%M:%S",@me)'/]
[field:pubdate function='strftime("%m-%d %H:%M:%S",@me)'/]
[field:pubdate function='strftime("%y年%m月%d日",@me)'/]
[field:pubdate function='strftime("%Y年%m月%d日 %H点%M分%S秒",@me)'/]
调用某个顶级栏目
{dede:type typeid='栏目ID'}
<A href="[field:typelink/]">[field:typename/]</A>
{/dede:type}
调用所有栏目(包括主栏目和子栏目)
{dede:channelartlist row='10' typeid='top' }
<a href='{dede:field name='typeurl'/}'> <b> {dede:field name='typename'/}
</b> </a>
{dede:channel type='son' noself='yes' }
<a href='[field:typelink/]'>[field:typename/]</a>
{/dede:channel}
{/dede:channelartlist}
相关文章
{dede:likearticle row='' titlelen='' infolen=''}
<a href='[field:arcurl/]'>[field:title/]</a>
{/dede:likearticle}
随机文章
{dede:arclist row=‘’ orderby=‘rand’ typeid='all' }
<li><a href="[field:arcurl/]">[field:title/]</a></li>
{/dede:arclist}
热门标签
{dede:tag row='10' getall='1' sort='month'}
<li><a href='[field:link/]'>[field:tag /]</a></li>
{/dede:tag}
内容页标题加链接
<a href="{dede:field name='arcurl'/}">{dede:field.title/}</a>
友情链接
图片:
<ul class="f5">
{dede:flink row='30'type='image'}
{/dede:flink}
</ul>
<ul class="f5">
{dede:flink row='24'/}
</ul>
首页调用商品价格:
{dede:arclist row='6' channelid='6' addfields='trueprice' orderby='pubdate'}
<li><span>[field:pubdate function="MyDate('m-d',@me)"/]</span><a
href="[field:arcurl/]">[field:title/]</a>([field:trueprice/]元)</li>
{/dede:arclist}
列表页调用模型自定义字段:(字段为图片(仅网址)
{dede:list row=8 titlelen=32 addfields='cpcc,cptp' channelid='1'}
<li>
<a href="[field:cptp/]" target="_blank">
<img src="[field:cptp/]" alt="产品图片" width="300" height="150"></a>
<a href="[field:cpcc/]" target="_blank">产品尺寸</a>
</li>
{/dede:list}
居中的CSS代码
marign:0 auto;
来隐藏溢出的文字或图片
overflow:hidden;
内容页分页代码
<div class="dede_pages">
<ul class="pagelist">
{dede:pagebreak/}
</ul>
</div>
内容分布CSS
.dede_pages ul{
float:left;
padding:12px 0px 12px 16px;
}
.dede_pages ul li{
float:left;
font-family:Tahoma;
line-height:17px;
margin-right:6px;
border:1px solid #E9E9E9;
}
.dede_pages ul li a{
float:left;
padding:2px 4px 2px;
color:#555;
display:block;
}
.dede_pages ul li a:hover{
color:#690;
text-decoration:none;
padding:2px 4px 2px;
}
.dede_pages ul li.thisclass,
.dede_pages ul li.thisclass a,.pagebox ul li.thisclass a:hover{
background-color:#F8F8F8;
padding:2px 4px 2px;
font-weight:bold;
}
.dede_pages .pageinfo{
line-height:21px;
padding:12px 10px 12px 16px;
color:#999;
}
.dede_pages .pageinfo strong{
color:#555;
font-weight:normal;
margin:0px 2px;
}
列表页分页CSS代码
<DIV class=article-page>
<DIV class=Page>
<UL>
{dede:pagelist listitem="info,index,end,pre,next,pageno,option"
listsize="5"/}
</UL></DIV> </DIV>
.article-page {
TEXT-ALIGN: center; MARGIN: 20px 20px 5px; FONT: 12px Arial,
Helvetica, sans-serif; CLEAR: both;
float:left;
}
.article-page A {
BORDER-BOTTOM: #185086 1px solid; BORDER-LEFT: #185086 1px solid;
PADDING-BOTTOM: 4px; LINE-HEIGHT: 16px; PADDING-LEFT: 9px; PADDING-RIGHT:
9px; ZOOM: 1; BACKGROUND: #fff; HEIGHT: 16px; COLOR: #185086; VERTICAL-ALIGN:
middle; BORDER-TOP: #185086 1px solid; CURSOR: pointer; MARGIN-RIGHT: 3px;
BORDER-RIGHT: #185086 1px solid; TEXT-DECORATION: none; PADDING-TOP: 4px;
border-radius: 3px
}
.Page{margin:0;padding:3px 5px;width:620px;height:30px;line-height:25px;text
-align:right;color:#333;background:url(/templets/default/images/AllBg.png)
repeat-x bottom left;overflow:hidden;border:#eee 1px solid}.Page li{margin:0
2px;display:inline;list-style:none}.Page a{color:#333}.Page a:hover
{color:#f00}.Page .n{margin:0 1px;padding:3px 6px;height:21px;line-
height:21px;color:#333;background:url(/templets/default/images/AllBg.png)
repeat-x bottom left;border:#e1e1e1 1px solid}.Page .m{margin:0
1px;padding:3px 6px;height:21px;line-height:21px;color:#f00;font-
weight:bold;background:url(/templets/default/images/AllBg.png) repeat-x
bottom left;border:#e1e1e1 1px solid}.page option{font-size:9px;color:#333}
织梦列表页简介字数设置
[field:description /]标签如何限制字数
[field:description function='cn_substr(@me,150)'/]
织梦cms获取当前栏目路径及栏目名称的标签调用
{dede:type}
<a href=" [field:typelink /] "> [field:typename /] </a>
{/dede:type}
织梦首页调用自定义字段
{dede:arclist addfields='附加字段1,附加字段2,附加字段3' row='8' channelid='自
定义模型id号'}
[field:textlink /] - [field:附加字段1/] - [field:附加字段2/] - [field:附加字
段3/] <br />
{/dede:arclist}
织梦内容页调用缩略图代码
<img src="{dede:field.picname/}" width="180" height="220" />
列表页调用字段,
[field:linkallplace/]
与内容页调用字段
{dede:field.infotype/}
调用当前栏目下的所有子栏目
子栏目:
{dede:channel type='son' currentstyle="<a href='~typelink~'
class='thisclass'>~typename~</a>"}
<A href="[field:typeurl/]"> [[field:typename/]] </A>{/dede:channel}
自定义button按钮,
<input type="button" value="提交" style="height=20px;width=50px;" />
外边距margin (可为负值)
内边距padding
幻灯片代码
<div class="flashnews">
<!-- size: 280px * 192px -->
<script language='javascript'>
linkarr = new Array();
picarr = new Array();
textarr = new Array();
var swf_width=280;
var swf_height=192;
//文字颜色|文字位置|文字背景颜色|文字背景透明度|按键文字颜色|按键默认颜色|按
键当前颜色|自动播放时间|图片过渡效果|是否显示按钮|打开方式
var configtg='0xffffff|0|0x3FA61F|5|0xffffff|0xC5DDBC|0x000033|2|3|1|_blank';
var files = "";
var links = "";
var texts = "";
//这里设置调用标记
{dede:arclist flag='f' row='5'}
linkarr[[field:global.autoindex/]] = "[field:arcurl/]";
picarr[[field:global.autoindex/]] = "[field:litpic/]";
textarr[[field:global.autoindex/]] = "[field:title function='html2text
(@me)'/]";
{/dede:arclist}
for(i=1;i<picarr.length;i++){
if(files=="") files = picarr;
else files += "|"+picarr;
}
for(i=1;i<linkarr.length;i++){
if(links=="") links = linkarr;
else links += "|"+linkarr;
}
for(i=1;i<textarr.length;i++){
if(texts=="") texts = textarr;
else texts += "|"+textarr;
}
document.write('<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000"
codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.c
ab#version=6,0,0,0" width="'+ swf_width +'" height="'+ swf_height +'">');
document.write('<param name="movie" value="{dede:global.cfg_templeturl
/}/default/images/bcastr3.swf"><param name="quality" value="high">');
document.write('<param name="menu" value="false"><param name=wmode
value="opaque">');
document.write('<param name="FlashVars"
value="bcastr_file='+files+'&bcastr_link='+links+'&bcastr_title='+texts+'&bca
str_config='+configtg+'">');
document.write('<embed src="{dede:global.cfg_templeturl
/}/default/images/bcastr3.swf" wmode="opaque"
FlashVars="bcastr_file='+files+'&bcastr_link='+links+'&bcastr_title='+texts+'
&bcastr_config='+configtg+'&menu="false" quality="high" width="'+ swf_width
+'" height="'+ swf_height +'" type="application/x-shockwave-flash"
pluginspage="http://www.macromedia.com/go/getflashplayer" />');
document.write('</object>');
</script>
</div>
搜索代码
<form name="formsearch" action="{dede:global.cfg_cmsurl/}/plus/search.php">
<input name="q" id="inp_name" class="input_out" type="text"
maxlength="20" style="height:18px;" value="产品型号或关键字..." onblur="if
(this.value==''){this.value='产品型号或关键字...';}"
this.onmouSEOut=function(){this.className='input_out'};"
onmousemove="this.className='input_move'"
onmouseout="this.className='input_out'"
/>
<button type="submit" id="searcbutton">Go</button>
</form>
CSS:
/*input*/
.input_on{
padding:2px 8px 0pt 3px;
height:18px;
border:1px solid #999;
background-color:#FFFFCC;
}
.input_off{
padding:2px 8px 0pt 3px;
height:18px;
border:1px solid #CCC;
background-color:#FFF;
}
.input_move{
padding:2px 8px 0pt 3px;
height:18px;
border:1px solid #999;
background-color:#FFFFCC;
}
.input_out{
/*height:16px;默认高度*/
padding:2px 8px 0pt 3px;
height:18px;
border:1px solid #CCC;
background-color:#F5F5F5;
}
/*form*/
ul.input_test{
margin:20px auto 0 auto;
width:500px;
list-style-type:none;
}
ul.input_test li{
width:500px;
height:22px;
margin-bottom:10px;
}
.input_test label{
float:left;
padding-right:10px;
width:100px;
line-height:22px;
text-align:right;
font-size:1.4em;
}
.input_test p{
float:left;
_margin-top:-1px;
}
.input_test span{
float:left;
padding-left:10px;
line-height:22px;
text-align:left;
font-size:1.2em;
color:#999;
}
form button{
width:52px;
height:24px;
border:none;
text-indent:-8000px;
overflow:hidden;
background:url(/templets/default/images/button.gif) no-repeat 0 0;
cursor:pointer;
vertical-align:middle;
position: relative;
}
form input{
width:160px;
padding:3px;
border-top-style: none;
border-right-style: none;
border-bottom-style: none;
border-left-style: none;
vertical-align: middle;
} |
|