1、经典案例:
图文列表:
{pc:content  action="position" posid="2" order="listorder DESC" num="4"}
             {loop $data $r}
                <h4 class="blue"><a href="{$r[url]}" title="{$r

[title]}">{str_cut($r[title],36,'')}-----------88888778-----</a></h4>
                <p>{if $n==1}<img src="{thumb($r[thumb],90,60)}"

width="90" height="60"/>{/if}{str_cut($r[description],112)}</p>
                <div class="bk20 hr"><hr /></div>
               {/loop}  
             {/pc}   
2、标题截取
{str_cut($r[title],36,'')}:截取36个字符
3、是不是第一条数据
{if $n==1}<img src="{thumb($r[thumb],90,60)}" width="90" height="60"/>

{/if}:如果是第一条数据,就显示缩略图({thumb($r[thumb],90,60)})

4、焦点图调用
  {pc:content  action="position" posid="1"  order="listorder DESC"

thumb="1" num="5"}
                <div class="content" id="main-slide">
                    <div class="changeDiv">  
                    {loop $data $r}
                        <a href="{$r['url']}" title="{str_cut($r

['title'],30)}"><img src="{thumb($r['thumb'],310,260)}" alt="{$r

['title']}" width="310" height="260" /></a>
                    {/loop}
                    </div>
                </div>
            {/pc}
必须有缩略图:thumb="1"
5、碎片
{pc:block pos="index_block_1"}{/pc} (pos:碎片位置标识符)

6.碎片格式化数据默认模板:
{$name}
<ul>
{loop $data $i $r}
<li style="clear:both">
<a href="{$r[url]}">{$r[title]}</a><br />
<div style="color:#ccc;">{if $r[thumb]}<img src="{$r[thumb]}"

style="float:left">{/if}{$r[desc]}
</div>
{/loop}
</li>
</ul>

如果存在缩略图,就显示出来:{if $r[thumb]}<img src="{$r[thumb]}"

style="float:left">{/if}

{thumb($r[thumb],110,0)}宽度:100,高度:自动。

7.隔行运算符:
{if $num%2!=0}style=" margin-right:10px"{/if}(如果是奇数行,就跟右边的距

离为10px)。
{if $num%2==0}<div class="bk10"></div>{/if}(如果是偶数行,就显示<div

class="bk10"></div>)
-----------------------------------------------
8.各个模型+一级栏目+最新缩略图+几篇文章
 {loop subcat(0,0,0,$siteid) $r}
        {php $num++}
        <div class="box cat-area" {if $num%2!=0}style=" margin-

right:10px"{/if}>
                <h5 class="title-1">{$r[catname]}{$r[catid]}<a

href="{$r[url]}" class="more">更多>></a></h5>
             <div class="content">
             {pc:content  action="lists" catid="$r[catid]"

order="updatetime DESC" thumb="1" num="1" return="info"}
             {loop $info $v}
                 <p>
                     <img src="{thumb($v[thumb],90,0)}" width="90"

height="60"/>
                    <strong><a href="{$v['url']}" target="_blank"

title="{$v['title']}"{title_style($v[style])}>{str_cut($v['title'],28)}

</a></strong><br />{str_cut($v['description'],100)}
                </p>
              {/loop}
              {/pc}                
                <div class="bk15 hr"></div>
                {pc:content action="lists" catid="$r[catid]" num="5"

order="id DESC" return="info"}

<ul class="list lh24 f14">
                {loop $info $v}
                    <li>·<a href="{$v['url']}" target="_blank"

title="{$v['title']}"{title_style($v[style])}>{str_cut($v['title'],40)}

</a></li>
                {/loop}
                </ul>
                {/pc}
            </div>
        </div>
        {if $num%2==0}<div class="bk10"></div>{/if}
        {/loop}
-------------------------------------------------
9.公告:
没有url,只能这样
{pc:announce  action="lists" siteid="$siteid" num="2"}
                <ul class="list lh24 f14">
                   {loop $data $r}
                     <li> <a href="{APP_PATH}index.php?

m=announce&c=index&a=show&aid={$r['aid']}">{$r['title']}</a></li>
                   {/loop}
                </ul>
                {/pc}
10.专题
{pc:special  action="lists" siteid="$siteid" elite="1" listorder="3"

num="2"}
            {loop $data $r}
                {if $n!=1}<div class="hr bk15"></div>{/if}
                <p style="margin:0">
                     <a href="{$r[url]}"><img src="{$r[thumb]}"

width="90" height="70" /></a>
                    <strong><a href="{$r[url]}">{str_cut($r

[title],'18')}</a></strong><br />{str_cut($r['description'],50)}
                </p>
            {/loop}
            {/pc}

elite="1":精华、加精
11.排行
{pc:content action="hits" catid="6" num="10" order="views DESC"}
                {loop $data $r}
                    <li><a href="{$r[url]}"

target="_blank" title="{$r[title]}"{title_style($r[style])}>{$r[title]}

</a></li>
                {/loop}
{/pc}

11.投票
<h5 class="title-2">调查问卷<a href="{APP_PATH}index.php?

m=vote&c=index&siteid={$siteid}" class="more">更多>></a></h5>
 
<script language="javascript" src="{APP_PATH}index.php?

m=vote&c=index&a=show&action=js&subjectid=1&type=3"></script>
12.申请友情链接
<h5><a href="{APP_PATH}index.php?m=link&siteid={$siteid}"

hidefocus="true" class="rt">更多>></a>友情链接<a href="{APP_PATH}

index.php?m=link&c=index&a=register&siteid={$siteid}" class="red">申请链

接</a></h5>

友情链接的设置内容:
{pc:link  action="type_list" siteid="$siteid" linktype="1"

order="listorder DESC" num="8" return="pic_link"}
        {loop $pic_link $v}

linktype="4" :文字的友情链接
linktype="1" :图片的友情链接
13.嵌套说明
{pc:link  action="type_list" siteid="$siteid" order="listorder DESC"

num="10" return="dat"}
    {loop $dat $v}
    <!--循环体-->
        {pc:link  action="type_list" siteid="$siteid" linktype="1"

order="listorder DESC" num="8" return="pic_link"}
        {loop $pic_link $v}
        <!--循环体-->
        {/loop}
        {/pc}

phpcms:五、网站首页(index.html)的更多相关文章

  1. phpcms v9网站搬家更换域名的方法

    PHPCMS 是国内领先的网站管理系统,同时也是一个开源的PHP开发框架. 本文介绍phpcms v9网站搬家更换域名的方法. 1.在新的主机空间把phpcms安装好. 新安装的版本一定要和准备搬迁的 ...

  2. dedecms如何随机调用指定分类下的文章到网站首页

    dedecms是全静态的,有时会因为其他事情好几天没写文章推荐到首页,那样对se不是很友好.原本ytkah是想在网站首页上半部分调用几篇id从200到500的文章随机展示的,这样每次更新首页给se的赶 ...

  3. 基于jQuery的网站首页宽屏焦点图幻灯片

    今天给大家分享一款基于jQuery的网站首页宽屏焦点图幻灯片.这款焦点图适用浏览器:IE8.360.FireFox.Chrome.Safari.Opera.傲游.搜狗.世界之窗.效果图如下: 在线预览 ...

  4. YII中面包屑制作(当前位置:网站首页 >> 会员登陆)

    面包屑制作(当前位置:网站首页 >> 会员登陆) 作用:就是在布局里要显示的信息,但这个信息在不同的页面里显示的内容不一样,例如:网页的title.网页的当前位置等等 1.布局中每个页面t ...

  5. 织梦DEDECMS网站首页如何实现分页翻页

    织梦DEDECMS模板网站首页如何实现首页分页和翻页 方法如下:(三种方法,自己选择一种来实现分页吧) 第一种:调用ajax和参数的(不推荐)1.必须在DEDE首页模板中的<head>&l ...

  6. 一种基于自定义代码的asp.net网站首页根据IP自动跳转指定页面的方法!

    一种基于自定义代码的asp.net网站首页根据IP自动跳转指定页面的方法! 对于大中型网站,为了增强用户体验,往往需要根据不同城市站点的用户推送或展现相应个性化的内容,如对于一些大型门户网站的新闻会有 ...

  7. wamp phpcms部署网站问题

    服务器使用自己的服务器,域名申请后通过信息服务iis管理器建网站,并将物理地址指定到wamp的www目录中的网站的根目录.这时候如果网站首页已经生成后访问域名将进入网站首页. 出现的问题: 1.导航( ...

  8. 保持url唯一性 解决多个网站首页问题

    原文地址:http://www.seowhy.com/bbs/thread-2694339-1-1.html 在网站SEO优化过程中,经常会遇到这样或者那样的常见技术型问题,达闻现将此类常见技术问题总 ...

  9. dedecms中去除首页index.html的方法

    本文介绍了dedecms中去除首页index.html的方法,有需要的朋友参考下. dedecms织梦cms建站程序输入地址后,而打开的实际地址后面有个index.html.   这里分享下两种解决方 ...

  10. HTML&CSS——使用DIV和CSS完成网站首页重构

    1.DIV 相关的技术 Div 它是一个 html 标签,一个块级元素(单独显示一行).它单独使用没有任何意义,必须结合CSS来使用.它主要用于页面的布局. Span 它是一个 html 标签,一个内 ...

随机推荐

  1. Linux红黑树(一)——数据结构

    摘要 兹博文探讨四个重点:1.简单介绍红黑树:2.红黑树节点数据结构:3.红黑树节点中父节点指针域和自身节点颜色有机结合:4.定义红黑树和操作树节点父节点指针和节点颜色的接口,包括一系列宏和两个函数. ...

  2. 经常使用ARM汇编指令

    一面学习,一面总结,一面记录. 以下是整理在网上找到的一些资料,简单整理记录一下,方便以后查阅. ARM处理器的指令集能够分为跳转指令.数据处理指令.程序状态寄存器(PSR)处理指令.载入/存储指令. ...

  3. 读《MacTalk&#183;人生元编程》及Mac经常使用软件

    引子 池建强的Blog:http://www.cnblogs.com/chijianqiang/ 用了1年多的黑苹果,是用Windows的思维用UI.用Linux的思维用Shell,折腾的是联想E49 ...

  4. Android学习笔记之viewholder

    在adapter中通过使用静态内部类(viewholder)缓存组件的引用来防止ListView刷新时重新LayoutInflater跟findViewById从而达到优化的目的.示例如下: @Ove ...

  5. Python进阶之路---1.5python数据类型-字符串

    字符串 *:first-child { margin-top: 0 !important; } body>*:last-child { margin-bottom: 0 !important; ...

  6. linux系统自动执行任务(转)

    开机启动 开机启动应该是我们很经常的需求了,我们常需要在开机时就自动执行某些命令来开启服务,进程等,有了它我们不必再在每次开机时输入同一堆命令. chkconfig命令 使用chkconfig命令可以 ...

  7. Sybase常用函数

    ==================================常用函数===========================================字符串函数1)ISNULL(EXP1, ...

  8. jdk-tomcat环境变量设置

    1.export命令直接在shell下设置 export JAVA_HOME=/home/yn4a/jdk1.6.0_16export PATH=$JAVA_HOME/bin:$PATHexport ...

  9. CentOS yum Fatal Error 处理一例

    环境说明 [root@thatsit ~]# cat /etc/redhat-release CentOS Linux release (Core) [root@thatsit ~]# uname - ...

  10. NHibernate+NUnit (VS2012+SQL Server2008) (转)

    源博客:http://blog.csdn.net/jiajiayouba/article/details/9877875 首先,你要明白,NHibernate在.NET中的作用和Hibernate在J ...