Created
August 2, 2013 06:16
-
-
Save sarices/6137834 to your computer and use it in GitHub Desktop.
dedecms 自动标题 无关键字和介绍时使用网站公共的数据
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<title>{dede:php} | |
$typeid = intval($refObj->Fields['typeid']); | |
$aid = intval($refObj->Fields['aid']); | |
if($aid>0) echo $refObj->Fields['title'].' - '; | |
if($typeid>0) echo $refObj->Fields['typename'].' - '; | |
{/dede:php}{dede:global.cfg_webname/}</title> | |
{dede:field.keywords runphp='yes'} | |
//自动匹配是否有值,无值使用系统配置的值 | |
$k = @me; | |
if($k=="") | |
{ | |
@me = "<meta name='keywords' content='".$GLOBALS["cfg_keywords"]."'/>"; | |
} | |
else | |
{ | |
@me = "<meta name='keywords' content='".$k."'/>"; | |
} | |
{/dede:field.keywords} | |
{dede:field.description runphp='yes'} | |
//自动匹配是否有值,无值使用系统配置的值 | |
$k = @me; | |
if($k=="") | |
{ | |
@me = "<meta name='description' content='".$GLOBALS["cfg_description"]."'/>"; | |
} | |
else | |
{ | |
@me = "<meta name='description' content='".$k."'/>"; | |
} | |
{/dede:field.description} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment