Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

The method of column filtering by adding notypeid attribute to Weaving Dream artlist tag

2025-02-05 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)06/02 Report--

This article mainly introduces the method of adding notypeid attribute to Weaving Dream artlist tag to achieve column filtering, which is very detailed and has a certain reference value. Interested friends must finish reading it!

How to make dream weaving artlist tag add notypeid attribute to achieve column filtering?

The function of dream-weaving tags is very powerful, as long as you are familiar with these tags and call various forms of background data in the foreground. Of course, if you can understand some technology and improve the label of dream weaving, it will be even more perfect.

Recommended study: dream weaving cms

Recently, I am expanding and subdividing the columns of my small station, from the original seven first-level columns to twelve first-level columns, and each first-level column is subdivided into four to eight second-level columns, in order to better manage the content.

But I encountered a problem, one of the columns I do not want it to be shown in the list of the latest articles on the home page, according to the existing way of dream weaving, that is, in the typeid attribute of the arclist tag, the column ID that you want to display the article is all set up, but there are too many IDs in this column, and it is troublesome to maintain it later, so I think since arclist supports flag and noflag, then you should also support typeid and notypeid, right?

After some testing, and then tracking the source code, it is found that Weaving Dream does not support notypeid, then what to do? Write it yourself!

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

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 (note the preceding comma) at the end of the parenthesis:

, $ctag- > GetAtt ('notypeid')

Then find this 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 parentheses (note the preceding comma):

, $notypeid=0

Finally, I found this sentence:

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

Add the following code before it:

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

In this way, the code has been modified. After saving it, try the notypeid attribute in the arclist tag. For many columns of the website, the content is displayed when the complex situation, such attributes are quite practical.

How to use it:

The code is as follows:

{dede:arclist row=6 orderby=pubdate type='image.' Imgwidth='108' imgheight='150' channelid='1' notypeid='9'} above are all the contents of the method of adding the notypeid attribute to the Weaving Dream artlist tag to achieve column filtering. Thank you for reading! Hope to share the content to help you, more related knowledge, welcome to follow the industry information channel!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report