GVKun编程网logo

织梦dedecms模板中channel无法调用指定栏目typeid(织梦cms调用栏目图片)

24

以上就是给各位分享织梦dedecms模板中channel无法调用指定栏目typeid,其中也会对织梦cms调用栏目图片进行解释,同时本文还将给你拓展dedecms调用指定栏目,指定作者,指定自定义字段

以上就是给各位分享织梦dedecms模板中channel无法调用指定栏目typeid,其中也会对织梦cms调用栏目图片进行解释,同时本文还将给你拓展dedecms 调用指定栏目,指定作者,指定自定义字段、DedeCms中Channel用typeid无效可用type调用、dedecms使用SQL代码调用指定栏目tag标签、dedeCMS标签中channelid和typeid的区别是什么等相关知识,如果能碰巧解决你现在面临的问题,别忘了关注本站,现在开始吧!

本文目录一览:

织梦dedecms模板中channel无法调用指定栏目typeid(织梦cms调用栏目图片)

织梦dedecms模板中channel无法调用指定栏目typeid(织梦cms调用栏目图片)

 
织梦dedecms模板中channel无法调用指定栏目typeid,,只后台栏目的排序显示,如果您需要指定ID调用可以使用channelartlist 标签
 
<ul>
{dede:channelartlist  type='top' row='6' typeid='1,2,3,4,5,6,7' }       
<li><a href="{dede:field.typelink/}"><p>{dede:field.typename/}</p></a></li>
{/dede:channelartlist}
</ul>
 
本文章网址:http://www.ppssdd.com/code/1134.html。转载请保留出处,谢谢合作!

dedecms 调用指定栏目,指定作者,指定自定义字段

dedecms 调用指定栏目,指定作者,指定自定义字段

百度知道里看到有人提问,帮写了一个。

 

模板里调用sql:

1
2
3
4
5
6
{dede:sql sql="select a.id,a.title,a.writer,a.pubdate,a.typeid,b.aid,b.sex from dede_archives a LEFT JOIN dede_addonarticle b on b.aid=a.id where a.typeid='7' and a.writer=~writer~ and b.sex='男' order by a.pubdate desc LIMIT 0,5"}
            文章ID:[field:id/]
"[field:id function='GetoneDocUrl(@me)'/]">[field:title/]
          {/dede:sql}

a.typeid=7   调用ID为7的栏目  如果不需要指定栏目ID  那么你可以把 a.typeid='7' and  删掉

a.writer=~writer~  调用当前文章的作者,调用指定的作者,可以这样写a.writer='admin'  这样就是指定调用admin这个作者的文档

b.sex=男  设置性别,也就是自定义字段。如果你的自定义字段不是sex 那么你只要把sql里的b.sex 改成你的字段,例如 name 改成b.name

LIMIT 0,5  设置要调用的条数,我这里写的是5条,自行修改.

指定调用2个栏目的话  可以把where a.typeid='7'  修改为 where a.typeid='7' and a.typeid='8'

这样就指定调用栏目ID 为 7和8的栏目

GetoneDocUrl 函数 放到incluce/extend.func.PHP 文件中,这个函数是用来调用文档的静态URL的。

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
function GetoneDocUrl($aid)
{
    global $dsql;
include_once(DEDEINC."/channelunit.func.PHP");
    $aid = trim(ereg_replace('[^0-9]',''PHP plain"php variable">));
 
$chRow ->Getone("Select arc.*,ch.maintable,ch.addtable,ch.issystem From `dede_arctiny` arc left join `dede_channeltype` ch on ch.id=arc.channel where arc.id='$aid' ");
 
if(!is_array($chRow)) {
        return $reArr;
    }
else {
(empty['maintable'])) ] = 'dede_archives';
}
 
'issystem']!=-1)
{
        $nquery = " Select arc.*,tp.typedir,tp.topid,tp.namerule,tp.moresite,tp.siteurl,tp.sitepath
                    From `{]}` arc left join `dede_arctype` tp on tp.id=arc.typeid
where arc.id='$aid' ";
}
else
{
PHP spaces"php keyword">as ismake,0 money,monospace; Box-sizing: content-Box !important; padding: 0px !important; color: blue !important; border-radius: 0px !important; border: 0px !important; bottom: auto !important; float: none !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; overflow: visible !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important; min-height: auto !important; word-break: break-all !important; background: none !important;">'' filename,tp.sitepath
'addtable']}` arc left join `dede_arctype` tp on tp.id=arc.typeid
where arc.aid=";
}
 
$arcRow ->Getone($nquery);
 
$Url = GetFileUrl($arcRow'typeid'],monospace; Box-sizing: content-Box !important; padding: 0px !important; color: blue !important; border-radius: 0px !important; border: 0px !important; bottom: auto !important; float: none !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; overflow: visible !important; position: static !important; right: auto !important; top: auto !important; vertical-align: baseline !important; width: auto !important; min-height: auto !important; word-break: break-all !important; background: none !important;">'senddate''title''ismake''arcrank''namerule''typedir''money''filename''moresite''siteurl''sitepath']);
$Url;
}
 

DedeCms中Channel用typeid无效可用type调用

DedeCms中Channel用typeid无效可用type调用

Dedecms中channel 用typeid调用无法达目的吗?请换成type试试!

{dede:channel type='son' typeid='19' row='1'}
typeid=19为
一个栏目下的第二个子栏目,在模版中想调取这个栏目的信息,用channel 虽然有解决办法,但是很繁琐,其实用{dede:type标签就很好实现了 : 
如下 

{dede:type typeid='19' }

总结

以上是小编为你收集整理的DedeCms中Channel用typeid无效可用type调用全部内容。

如果觉得小编网站内容还不错,欢迎将小编网站推荐给好友。

dedecms使用SQL代码调用指定栏目tag标签

dedecms使用SQL代码调用指定栏目tag标签

 

在使用织梦CMS建站中,很有可能需要用到在首页根据调用某个栏目下的TAG,也就是是按栏目调出TAG,这里就需要用到DEDE 的SQL运行功能
{dede:sql sql="select * from dede_archives a left join dede_taglist t on a.id=t.aid where a.typeid='22' limit 4"}
   <a href='/tags.php?[field:tag/]' target="_blank" title="[field:tag /]">[field:tag /]</a>
{/dede:sql}

这里typeid=‘22’可以改成你实际要调用的栏目ID,limit 4这个是调用多少个TAG出来

以上的代码是随便哪里都可以用
如果是要再列表页调用,还有一个代码
[field:id runphp=yes]  
    $tsql = new DedeSql(false);  
    $tags = '';  
    $tsql->SetQuery("Select i.tagname From dede_tag_list t left join dede_tag_index i on i.id=t.tid where t.aid='@me'");  
    $tsql->Execute('t');  
    while($row = $tsql->GetArray('t',MYSQL_ASSOC)){  
    $tags .= "<a href='/tag.php?/".urlencode($row['tagname'])."'>".$row['tagname']."</a>";  
    }  
    @me=$tags;  
    [/field:id]

如果是DEDE5.7 及之后的版本,可以直接在列表页用
[field:id function=GetTags(@me)/] 就能直接调用,但是调用出来是不带链接的,如果需要链接,请注释掉include\helpers\archive.helper.php文件的130行: $tags .= ($tags=='' ? $row['tag'] : ','.$row['tag']);   用下面语句替换,当然你也可以加入自己的样式:$tags .= "<a href='/tags.php?/".urlencode($row['tag'])."/'>".$row['tag']."</a> "; 本文章网址:http://www.ppssdd.com/code/10386.html。转载请保留出处,谢谢合作!

dedeCMS标签中channelid和typeid的区别是什么

dedeCMS标签中channelid和typeid的区别是什么

dedeCMS标签中channelid和typeid的区别是什么

织梦dedeCMS标签中channelid和typeid的区别

channelid频道调用是在内容模型里管理,频道名称的前面也有一个id,这个ID用 channelid调用。

1.jpg

这个调用需要频道里面有子栏目才可以的,而typeid 就是纯粹的栏目调用 可以调用里面的文章

2.jpg

更多相关知识,请访问 PHP中文网!!

我们今天的关于织梦dedecms模板中channel无法调用指定栏目typeid织梦cms调用栏目图片的分享就到这里,谢谢您的阅读,如果想了解更多关于dedecms 调用指定栏目,指定作者,指定自定义字段、DedeCms中Channel用typeid无效可用type调用、dedecms使用SQL代码调用指定栏目tag标签、dedeCMS标签中channelid和typeid的区别是什么的相关信息,可以在本站进行搜索。

本文标签: