• Thinkcmf:页面常用函数


    Thinkcmf:页面常用函数

    全站seo:

    文章列表:

    {$site_seo_title}        <!--SEO标题-->

    {$site_seo_keywords}   <!--SEO关键字-->

    {$site_seo_description}  <!--SEO描述-->

    {$seo_title}          <!--SEO标题-->

    {$seo_keywords}      <!--SEO关键字-->

    {$seo_description}     <!--SEO描述-->

    文章页:

    页面:

    {$post_title}    <!-- 文章标题--> {$post_keywords} <!--关键字--> {$post_excerpt}  <!-- 文章摘要-->

    {$post_title}    <!-- 文章标题--> {$post_keywords} <!--关键字--> {$post_excerpt}  <!-- 文章摘要-->

    标题:         <title>{$site_seo_title} {$site_name}</title>

    关键字: <meta name="keywords" content="{$site_seo_keywords}" />

    网站描述: <meta name="description" content="{$site_seo_description}">

    包含文件: <tc_include file="Public:head" />

    幻灯片展示:sp_getslide()

    <php> //幻灯片展示

    $home_slides=sp_getslide("portal_index");  ////top_slide是你在后台创建的幻灯片标识

    $home_slides=empty($home_slides)?$default_home_slides:$home_slides; //打印获取结果

    </php>

    <foreach name="slides" item="vo"> //遍历幻灯片信息

        <!--{$vo.slide_id}幻灯片id-->

        <!--{$vo.slide_cid}幻灯片分类id,对应于slide_cat表里的cid-->

        <!--{$vo.slide_name}幻灯片名称-->

        <!--{$vo.slide_pic}幻灯片图片路径相对于upload文件夹/data/upload/-->

        <!--{$vo.slide_url}幻灯片链接地址-->

        <!--{$vo.slide_des}幻灯片描述-->

        <!--{$vo.slide_content}幻灯片内容-->

        <a href="{$vo.slide_url}" target="_blank" title="{$vo.slide_content}">

            <img src="/data/upload/{$vo.slide_pic}"/></a>

    </foreach>

    幻灯片对应的配置

    ThinkCMF使用config.html来配置每一个有特殊要求的页面,默认模板只对首页进行了配置

    <php>

    /*首页配置*/  config.html配置模块

    $Portal_index= array(

    'Article'=>array( 'ThinkCMF' => '65',/*文章ID*/ ),

     'Page'=>array(),

     'Cat'=>array('Advantage'  => '11', 'Presentation' => '10',//配分类模块

                    'Lastnews' => '8',    'Product'  =>'7', ),

     'Slide'=>array( 'mid_slide' => 'mid_slide' ),   ); //中部幻灯片

    </php>

    变量解释:

    $Portal_index             Portal应用首页配置

        Article                   文章相关配置

    Page                      页面相关配置

    Cat                       分类相关配置

    Slide                     幻灯片相关配置

  • 相关阅读:
    HTML5新标签与特性---多媒体
    HTML5新标签与特性---新表单+新属性----综合案例1
    字体图标引入到HTML---复制用代码
    字体图标网站---常用汇总
    滑动门出现的背景---实例微信导航栏(a盒子里面包span盒子,文字写在span里)
    【Web前端开发】---前端培训roadmap
    清除浮动的4种方法
    进度更新---Responsive Web Design Certification (300 hours)
    Python实现一个桌面版的翻译工具【新手必学】
    Python爬虫老是被封的解决方法【面试必问】
  • 原文地址:https://www.cnblogs.com/jingzi111/p/5044982.html
Copyright © 2020-2023  润新知