{"id":1496,"date":"2018-01-08T17:14:25","date_gmt":"2018-01-08T09:14:25","guid":{"rendered":"http:\/\/www.baishitou.cn\/?p=1496"},"modified":"2018-11-11T00:36:54","modified_gmt":"2018-11-10T16:36:54","slug":"%e7%bb%87%e6%a2%a6dedecms%e8%ae%a9channelartlist%e6%a0%87%e7%ad%be%e9%87%8c%e7%9a%84channel%e6%94%af%e6%8c%81currentstyle","status":"publish","type":"post","link":"https:\/\/www.baishitou.cn\/1496.html","title":{"rendered":"\u7ec7\u68a6dedecms\u8ba9channelartlist\u6807\u7b7e\u91cc\u7684channel\u652f\u6301currentstyle\u5f53\u524d\u680f\u76ee\u9ad8\u4eae"},"content":{"rendered":"
\u6253\u5f00 \/include\/taglib\/channelartlist.lib.php \u627e\u5230<\/p>\n
$pv->Fields['typeurl'] = GetOneTypeUrlA($typeids[$i]);<\/code><\/pre>\n\u5927\u7ea6\u572893\u884c\uff0c\u5728\u5b83\u4e0b\u9762\u6dfb\u52a0<\/p>\n
if($typeids[$i]['id'] == $refObj->TypeLink->TypeInfos['id'] || $typeids[$i]['id'] == $refObj->TypeLink->TypeInfos['reid'] || $typeids[$i]['id'] == $refObj->TypeLink->TypeInfos['topid'] || $typeids[$i]['id'] == GetTopid($refObj->TypeLink->TypeInfos['id']) )\r\n{\r\n\t$pv->Fields['currentstyle'] = $currentstyle ? $currentstyle : 'current';\r\n}\r\nelse\r\n{\r\n\t$pv->Fields['currentstyle'] = '';\r\n}<\/code><\/pre>\n <\/p>\n
\u7ec7\u68a6\u6807\u7b7echannelartlist\u9ed8\u8ba4\u662f\u4e0d\u652f\u6301\u591a\u5c42\u5d4c\u5957\u540e\u4f7f\u7528currentstyle\u9ad8\u4eae\uff0c\u4fee\u6539\u4e00\u4e2a\u6587\u4ef6\u53ef\u4ee5\u5b9e\u73b0,\u6a21\u677f\u91cc\u8c03\u7528\u4ee3\u7801\uff1a\u91cc\u9762\u7684hover<\/code>\u5c31\u662f\u4f60\u7684\u9ad8\u4eae\u6837\u5f0f\uff0c<\/p>\n<div class=\"nav\">\r\n <ul>\r\n {dede:channelartlist row=7 typeid=top currentstyle=hover<\/strong>}\r\n <li class=\"{dede:field.currentstyle\/}\">\r\n <a href=\"{dede:field.typeurl\/}\">{dede:field.typename\/}<\/a>\r\n <ul>\r\n {dede:channel type='son' noself='yes' row='10' currentstyle=\"<li class='hover<\/strong>'><a href='~typelink~'>~typename~<\/a><\/li>\"}\r\n <li><a href=\"[field:typeurl\/]\">[field:typename\/]<\/a><\/li>\r\n {\/dede:channel}\r\n <\/ul>\r\n <\/li>\r\n {\/dede:channelartlist}\r\n <\/ul>\r\n<\/div><\/code><\/pre>\n <\/p>\n
\u6253\u5f00 \\include\\taglib\\channel.lib.php<\/p>\n
\u641c\u7d22<\/p>\n
global<\/span><\/span> $dsql<\/span><\/span>;<\/span><\/span><\/code><\/pre>\n\u4fee\u6539\u6210\uff1a<\/p>\n
global<\/span><\/span> $dsql<\/span><\/span>,<\/span><\/span>$_sys_globals<\/span><\/span>;<\/span><\/span><\/code><\/pre>\n\u7ee7\u7eed\u641c\u7d22<\/p>\n
$row<\/span><\/span>[<\/span><\/span>'id'<\/span><\/span>]<\/span><\/span>==<\/span><\/span>$typeid<\/span><\/span><\/code><\/pre>\n\u4fee\u6539\u6210\uff1a<\/p>\n
$row<\/span><\/span>[<\/span><\/span>'id'<\/span><\/span>]<\/span><\/span>==<\/span><\/span>$typeid<\/span><\/span> ||<\/span><\/span> $row<\/span><\/span>[<\/span><\/span>'id'<\/span><\/span>]<\/span><\/span>==<\/span><\/span>$_sys_globals<\/span><\/span>[<\/span><\/span>'typeid'<\/span><\/span>]<\/span><\/span><\/code><\/pre>\n <\/p>\n
<\/p>\n
<\/p>\n
<\/p>\n
<\/p>\n","protected":false},"excerpt":{"rendered":"
\u7ec7\u68a6dedecms\u8ba9channelartlist\u6807\u7b7e\u91cc\u7684channel\u652f\u6301currentstyle\u5f53\u524d\u680f\u76ee\u9ad8\u4eae […]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[3],"tags":[43,672,459,180],"class_list":["post-1496","post","type-post","status-publish","format-standard","hentry","category-web","tag-dedecms","tag-672","tag-459","tag-180"],"_links":{"self":[{"href":"https:\/\/www.baishitou.cn\/wp-json\/wp\/v2\/posts\/1496","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.baishitou.cn\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.baishitou.cn\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.baishitou.cn\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.baishitou.cn\/wp-json\/wp\/v2\/comments?post=1496"}],"version-history":[{"count":0,"href":"https:\/\/www.baishitou.cn\/wp-json\/wp\/v2\/posts\/1496\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.baishitou.cn\/wp-json\/wp\/v2\/media?parent=1496"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.baishitou.cn\/wp-json\/wp\/v2\/categories?post=1496"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.baishitou.cn\/wp-json\/wp\/v2\/tags?post=1496"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}