GetAtt('notypeid')"; then use "notype" in the arclist tag Just attribute."/> GetAtt('notypeid')"; then use "notype" in the arclist tag Just attribute.">

Home >CMS Tutorial >DEDECMS >How to add the notypeid attribute to the DreamWeaver artlist tag to implement column filtering

How to add the notypeid attribute to the DreamWeaver artlist tag to implement column filtering

藏色散人
藏色散人Original
2019-12-02 09:44:141714browse

How to add the notypeid attribute to the DreamWeaver artlist tag to implement column filtering

How to add the notypeid attribute to the DreamWeaver artlist tag to implement column filtering?

DreamWeaver's tag function is very powerful. As long as you are familiar with these tags, you will be able to call various forms of background data in the foreground with ease. Of course, it would be even more perfect if we could understand some technology and improve the label of DreamWeaver.

Recommended study: 梦Weavercms

I have recently been expanding and subdividing the columns of my small site, from the original seven first-level columns to ten Two first-level columns, each first-level column is further subdivided into four to eight second-level columns for better content management.

But I encountered a problem. I don’t want one of the columns to be displayed in the latest article list on the homepage. According to DreamWeaver’s existing method, it is to change the typeid attribute of the arclist tag to display the article. All column IDs are set, but there are too many column IDs, which will be troublesome to maintain in the future, so I think since arclist supports flag and noflag, it should also support typeid and notypeid, right?

After some testing and tracing the source code, I found that Notypeid is not supported by Dreamweaver. What should I do? Write it yourself!

Open the /include/taglib/arclist.lib.php file and look for this code (about line 130):

return lib_arclistDone 
       ( 
         $refObj, $ctag, $typeid, $ctag->GetAtt('row'), $ctag->GetAtt('col'), $titlelen, $infolen, 
         $ctag->GetAtt('imgwidth'), $ctag->GetAtt('imgheight'), $listtype, $orderby, 
         $ctag->GetAtt('keyword'), $innertext, $envs['aid'], $ctag->GetAtt('idlist'), $channelid, 
         $ctag->GetAtt('limit'), $flag,$ctag->GetAtt('orderway'), $ctag->GetAtt('subday'), $ctag->GetAtt('noflag'), 
         $tagid,$pagesize,$isweight         
     );

Add at the end of the last bracket (note the comma in front):

,$ctag->GetAtt('notypeid')

Then find this piece of code (about line 168):

function lib_arclistDone(&$refObj, &$ctag, $typeid=0, $row=10, $col=1, $titlelen=30, $infolen=160, 
        $imgwidth=120, $imgheight=90, $listtype='all', $orderby='default', $keyword='', 
        $innertext='', $arcid=0, $idlist='', $channelid=0, $limit='', $att='', $order='desc', $subday=0, $noflag='',$tagid='', $pagesize=0, $isweight='N')

Add at the end of the brackets (note the comma in front):

,$notypeid=0

Finally find it again This sentence:

$orwheres[] = ' arc.arcrank > -1 ';

Add the following code in front of it:

if(!empty($notypeid))  
{ 
    $orwheres[] = " and arc.typeid NOT IN (".GetSonIds($notypeid).")"; 
}

In this way, the code is modified. After saving, try the notypeid attribute in the arclist tag. For websites with many columns and complicated content display, this attribute is quite practical.

Usage:

The code is as follows:

{dede:arclist row=6 orderby=pubdate type='image.' imgwidth='108' imgheight='150' channelid='1' notypeid='9'}

The above is the detailed content of How to add the notypeid attribute to the DreamWeaver artlist tag to implement column filtering. For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn