dedecms获取文档当前栏目所在目录链接URL

| | Comments (1)



dedecms内容页调用当前栏目其实用下来是调用不出来的,{dede:field.typename/}是有效的,可是{dede:field.typeurl/}却调不出文档当前栏目所在目录链接URL。查了下网上有网友提供了解决的办法,贴出来大家分享:

方法一:
{dede:type typeid='0′ row=1}[field:typelink /]{/dede:type}

方法二:
动手改装一下函数了,利用DEDECMS自定义函数的接口文件,我们在文章页中的标记以

{dede:field.typeid function='typeurl_arc(@me)'/}这个放在内容页的模板中,

下把如下函数:

function typeurl_arc($typeid){
$typeurl = ";
$dsql = new DedeSql(false);
$row = $dsql ->GetOne("select typedir from #@__arctype where id=$typeid");
$typeurl = MfTypedir($row['typedir']);
return $typeurl;
}

丢进extend.func.php

注:MfTypedir为dedecms系统内置函数


同样的是获取文档所在当前目录,还是第一个简单啊,呵呵,当然我想应该不是所在目录的一级目录,我想要的是这个,所以这两个方法不适合我。暂时没有找到调用所在一级目录的方法,有了后续补上。。。。


补充:dedecms获取当前文档url地址的方法:{dede:field name='arcurl'/}


单点日志:http://spoint.babyshoot.cn/

1 Comments

呵呵,技术性文章都多分享啊……学习了!dede没用过,一直用的其他的!

Leave a comment

Archives

Ads by google

Pages

Powered by Movable Type 4.24-en

About this Entry

This page contains a single entry by 单点日志 published on July 28, 2011 11:10 PM.

The dirty punk anarchy machine(flash rock game) was the previous entry in this blog.

DOT中国域名的作用 is the next entry in this blog.

Find recent content on the main index or look in the archives to find all content.