返回列表2015.09.22

[模板范例] 文章内容页

文章内容页模板范例

{include file=$_Y['template']['header']}

<div class="cl">
	<!--关于/资讯/网络-->
    <div class="left">
        <div>{$cat['title']}<span>{$cat['subtitle']}</span></div>
        <ul class="menu_name">
        	{if $cat['sub']}
            	{foreach $cat['sub'] as $v}
                <li {if $cat['catid'] == $v}class="a"{/if}><a href="{$_Y['basescript']}-list-{$v}-1.html">{$cats[$v]['title']}</a></li>
            	{/foreach}
        	{elseif $cat['other']}
            	{foreach $cat['other'] as $v}
                <li {if $cat['catid'] == $v}class="a"{/if}><a href="{$_Y['basescript']}-list-{$v}-1.html">{$cats[$v]['title']}</a></li>
            	{/foreach}
            {/if}
        </ul>
    </div>
    
     <div class="right">
        <div class="page_box">
            <div class="page_title">
            	<h3>{$article['title']}</h3>
                <p class="info">
                    PostTime:{date style="Y-m-d h:m" time=$article['dateline']}
                    {if $article['author']}
                    <span>发布人:{$article['author']}</span>
                    {/if}
                    <span>阅读:{$article['views']}</span>
                    {if $article['from']}
                    <span>来源:<a href="{$article['fromurl']}">{$article['from']}</a></span>
                    {/if}
                    {nocache}
                    {if $_Y['self']}
                    <span><a href="{$_Y['basescript']}.php?mod=add&aid={$article['aid']}">编辑</a></span>
                    <span> <a  href="{$_Y['basescript']}.php?mod=delete&aid={$article['aid']}&catid={$cat['catid']}&formhash={$_Y['formhash']}" onClick="showAsk('您确定要删除这篇文章吗,删除后还可以在回收站里找回',this.href);return false">删除</a></span>
                    {/if}
                    {/nocache}
                </p>
            </div>
            <div class="article">
            	{$article['content']}
            </div>
            <div>
            	{if $article['prev']}<p>上一篇:<a href="{$_Y['basescript']}-article-{$article['prev']['aid']}.html">{$article['prev']['title']}</a></p>{/if}
                {if $article['next']}<p>下一篇:<a href="{$_Y['basescript']}-article-{$article['next']['aid']}.html">{$article['next']['title']}</a></p>{/if}
            </div>
        </div>
        
    </div>
</div>

{include file=$_Y['template']['footer']}

说明:本例是演示变量的使用,代码结构没有要求