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

藏色散人
Release: 2019-12-02 09:44:14
Original
1726 people have browsed it

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         
     );
Copy after login

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

,$ctag->GetAtt('notypeid')
Copy after login

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')
Copy after login

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

,$notypeid=0
Copy after login

Finally find it again This sentence:

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

Add the following code in front of it:

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

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'}
Copy after login

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!

Related labels:
source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template