欢迎访问2017年洛阳SEO牛广的官方博客,只要标题有亲测有效的都是原创文章。为大家提供最新真实有效的案例,承接网站SEO百度优化业务QQ:939380096

DEDECMS主菜单和子菜单双选中高亮效果代码—亲测有效

dede niuguang 1262次浏览 40个评论

洛阳SEO 牛广 学习dede仿站笔记 实现 主菜单和子菜单双选中高亮效果 这个在网站制作中使用非常频繁。

如图下:

dede

废话不多讲 请看下文操作方法。

1) 找到dede系统文件

文件位置为 include\taglib\channelartlist.lib.php

打开后找到查找下面代码

$pv->Fields['typeurl'] = GetOneTypeUrlA($typeids[$i]); 

2) 在此行代码下方增加以下代码:

if($typeids[$i]['id'] == $refObj->TypeLink->TypeInfos['id'] || $typeids[$i]['id'] == $refObj->TypeLink->TypeInfos['topid'] ){ 
            $pv->Fields['currentstyle'] = $currentstyle ? $currentstyle : 'current'; 
        } 
        else{ 
            $pv->Fields['currentstyle'] = ''; 
        } 

如下图:

dede

 保存关闭文件。

 3) 在模板里面调用代码

 {dede:channelartlist typeid='2' currentstyle='hover'}
<li class='{dede:field.currentstyle/}'><a href='{dede:field name='typeurl'/}'>{dede:field name='typename'/}</a></li>
{/dede:channelartlist}

   typeid=”这个里面写对应的二级id编号”,(就是要显示的二级菜单) 列如   typeid=”7,8,9,10″

   currentstyle=”这个里面写选择后的class样式名称”      列如    currentstyle=”hover” 

   其他不需要修改,然后去后台 更新栏目缓存 一键更新网站。 

    以上内容由洛阳SEO 牛广真情送上 http://www.xiaoguangseo.com


小广 , 版权所有丨如未注明 , 均为原创丨本网站采用BY-NC-SA协议进行授权 , 转载请注明DEDECMS主菜单和子菜单双选中高亮效果代码—亲测有效
喜欢 (0)
发表我的评论
取消评论
表情 贴图 加粗 删除线 居中 斜体 签到
(40)个小伙伴在吐槽
  1. I have to express some appreciation to this writer just for rescuing me from this type of scenario. Just after looking throughout the search engines and seeing thoughts that were not beneficial, I was thinking my life was done. Being alive devoid of the answers to the problems you have solved by way of your entire report is a serious case, and the ones which could have negatively affected my career if I had not encountered your site. Your main natural talent and kindness in controlling all the pieces was very helpful. I'm not sure what I would have done if I had not discovered such a step like this. It's possible to now look ahead to my future. Thanks so much for your professional and sensible help. I will not be reluctant to recommend your blog to any individual who needs to have care about this topic. [url=http://www.nikeairforce1.us.com]air force 1[/url]
    匿名2018-06-04 07:39 回复
  2. WONDERFUL Post.thanks for share..more wait .. ?
    匿名2018-06-05 09:18 回复
  3. I wish to convey my affection for your kind-heartedness supporting those people who really want assistance with the area. Your very own commitment to getting the solution along has been extraordinarily advantageous and have truly encouraged guys much like me to arrive at their pursuits. Your personal interesting report signifies so much a person like me and somewhat more to my colleagues. Many thanks; from everyone of us. nmd uk [url=http://www.adidasnmd.uk]nmd uk[/url]
    匿名2018-06-05 09:25 回复
  4. I wanted to send a quick word to be able to say thanks to you for all the unique advice you are showing on this website. My rather long internet lookup has at the end of the day been paid with sensible details to exchange with my companions. I would point out that many of us site visitors are undoubtedly fortunate to live in a remarkable website with so many wonderful people with interesting points. I feel somewhat grateful to have used your website and look forward to tons of more fun moments reading here. Thanks once again for all the details. ray ban [url=http://www.rayban-sunglassesonline.us.com]ray ban[/url]
    匿名2018-06-06 05:36 回复
  5. I simply wanted to type a simple remark so as to express gratitude to you for all the lovely recommendations you are sharing at this website. My long internet investigation has finally been honored with incredibly good strategies to talk about with my colleagues. I would claim that many of us site visitors are unequivocally endowed to live in a great network with very many lovely individuals with good tricks. I feel pretty grateful to have discovered your entire website and look forward to some more cool minutes reading here. Thanks a lot once again for everything. balenciaga speed [url=http://www.balenciaga.us.com]balenciaga speed[/url]
    匿名2018-06-06 17:56 回复
  6. I want to get across my passion for your kindness for persons who should have help on this matter. Your personal commitment to passing the message all over appeared to be exceptionally beneficial and has really empowered guys like me to arrive at their dreams. The warm and helpful information entails a whole lot to me and substantially more to my office colleagues. Thanks a lot; from all of us. foamposites [url=http://www.nikefoamposite.us.com]foamposites[/url]
    匿名2018-06-07 05:59 回复
  7. I just wanted to type a small remark in order to appreciate you for all of the fantastic advice you are placing on this site. My prolonged internet research has finally been compensated with wonderful ideas to exchange with my great friends. I 'd declare that we site visitors actually are undeniably blessed to live in a superb community with many outstanding professionals with useful advice. I feel very happy to have encountered the website page and look forward to some more amazing moments reading here. Thanks once more for all the details. nmd [url=http://lovebyt.es/nmds]nmd[/url]
    匿名2018-06-07 07:13 回复
  8. Thank you a lot for providing individuals with a very spectacular possiblity to discover important secrets from this web site. It's always so awesome and also packed with a good time for me personally and my office friends to search the blog at least 3 times in one week to see the latest tips you have. Not to mention, we are at all times satisfied with your excellent solutions you give. Certain two ideas on this page are indeed the most effective we've ever had. nike air max shoes [url=http://www.nikeair-max.us.com]nike air max shoes[/url]
    匿名2018-06-07 19:50 回复
  9. I would like to show my appreciation to you for bailing me out of such a matter. Because of browsing throughout the world wide web and getting principles which were not powerful, I believed my life was done. Being alive without the answers to the problems you have resolved by way of this website is a critical case, and the ones which may have badly affected my entire career if I hadn't come across your website. Your good mastery and kindness in maneuvering every part was invaluable. I don't know what I would have done if I had not encountered such a stuff like this. It's possible to at this time look forward to my future. Thank you very much for this expert and results-oriented help. I will not think twice to suggest your blog post to any person who desires tips on this topic. michael kors outlet [url=http://www.michael--korsoutlet.us.org]michael kors outlet[/url]
    匿名2018-06-08 07:23 回复
  10. Can I simply say what a reduction to seek out someone who really is aware of what theyre talking about on the internet. You positively know how one can bring an issue to gentle and make it important. Extra folks have to read this and perceive this facet of the story. I cant imagine youre no more common since you definitely have the gift.
    匿名2018-06-08 10:32 回复
  11. I in addition to my guys appeared to be looking at the good key points on the website then quickly I got a horrible feeling I never thanked you for those strategies. Those women became so happy to see them and have now in truth been enjoying those things. Appreciation for being indeed helpful and for having these kinds of amazing areas most people are really eager to be aware of. Our honest apologies for not saying thanks to earlier. nba jerseys [url=http://www.cheapnbajerseys.us.org]nba jerseys[/url]
    匿名2018-06-08 21:45 回复
  12. I not to mention my guys came digesting the great tips located on your site then the sudden got a terrible feeling I had not expressed respect to you for those strategies. Most of the guys happened to be certainly happy to read through all of them and have in effect simply been tapping into them. Thanks for genuinely indeed considerate and also for deciding upon some really good tips millions of individuals are really wanting to be aware of. My very own honest regret for not expressing gratitude to earlier. adidas eqt [url=http://www.adidas-eqt.us.com]adidas eqt[/url]
    匿名2018-06-09 10:16 回复
  13. My husband and i felt relieved when Albert managed to do his investigation through your precious recommendations he received through your web site. It is now and again perplexing to simply choose to be releasing thoughts that many people might have been making money from. And we all understand we've got the website owner to thank because of that. The specific explanations you made, the easy site navigation, the relationships you can make it possible to foster - it's got many astounding, and it is making our son and the family imagine that the theme is excellent, which is certainly very serious. Many thanks for all the pieces! true religion jeans [url=http://www.truereligion-outlets.us.com]true religion jeans[/url]
    匿名2018-06-10 02:25 回复
  14. I precisely had to appreciate you once again. I am not sure what I would have made to happen in the absence of the type of pointers revealed by you regarding such subject. It absolutely was an absolute alarming situation for me personally, nevertheless encountering a specialized style you managed that forced me to weep over happiness. Now i am thankful for your support and as well , have high hopes you are aware of an amazing job you are always doing training the rest through the use of your webblog. I am certain you have never encountered any of us. adidas stan smith men [url=http://www.adidasstansmith.us.com]adidas stan smith men[/url]
    匿名2018-06-10 15:12 回复
  15. I precisely needed to say thanks all over again. I do not know the things I could possibly have sorted out in the absence of the actual advice provided by you over my concern. It was before a real distressing difficulty in my position, nevertheless looking at your well-written form you dealt with the issue forced me to leap for happiness. I will be grateful for your information and in addition have high hopes you find out what an amazing job you happen to be getting into teaching people today all through your websites. I am sure you've never met all of us. yeezy boost 350 [url=http://www.yeezyboost350v2shoes.us.com]yeezy boost 350[/url]
    匿名2018-06-11 01:03 回复
  16. I definitely wanted to compose a brief comment so as to express gratitude to you for the amazing items you are showing at this site. My considerable internet research has at the end of the day been rewarded with good strategies to go over with my classmates and friends. I would tell you that many of us visitors are very much endowed to dwell in a useful place with very many lovely individuals with interesting guidelines. I feel extremely grateful to have discovered your entire web pages and look forward to some more amazing moments reading here. Thank you once again for all the details. westbrook shoes [url=http://www.russellwestbrookshoes.us]westbrook shoes[/url]
    匿名2018-06-11 06:19 回复
  17. My spouse and i were so peaceful Michael could finish off his investigations because of the precious recommendations he had while using the web page. It is now and again perplexing to just choose to be offering techniques that men and women may have been making money from. And we consider we need the website owner to be grateful to for this. The most important illustrations you made, the straightforward blog navigation, the friendships you give support to foster - it's mostly sensational, and it's really assisting our son and us do think the issue is pleasurable, and that's particularly fundamental. Thanks for all the pieces! adidas tubular [url=http://www.adidastubular.co.uk]adidas tubular[/url]
    匿名2018-06-11 20:16 回复
  18. I intended to create you this very small remark just to thank you yet again considering the pleasant tactics you've contributed on this site. It was simply extremely generous of people like you to allow publicly what exactly most of us could have offered for sale for an e book to end up making some bucks for themselves, even more so now that you might have tried it in the event you desired. Those things in addition served to become a great way to fully grasp most people have a similar dream like my very own to find out a whole lot more with reference to this problem. I'm certain there are thousands of more pleasurable instances up front for many who look into your blog post. nike air max 270 [url=http://www.airmax270.us.com]nike air max 270[/url]
    匿名2018-06-12 08:05 回复
  19. I must show my respect for your generosity for those individuals that must have assistance with in this area of interest. Your very own commitment to passing the solution throughout has been remarkably effective and have usually encouraged people like me to attain their endeavors. Your own warm and helpful advice means a great deal a person like me and especially to my colleagues. With thanks; from all of us. yeezy shoes [url=http://www.yeezy-shoes.us.org]yeezy shoes[/url]
    匿名2018-06-12 21:57 回复
  20. I wish to express my appreciation to you for rescuing me from such a dilemma. Right after scouting throughout the search engines and seeing proposals which are not beneficial, I assumed my life was gone. Being alive devoid of the strategies to the difficulties you've fixed by means of this review is a critical case, and those that would have negatively affected my entire career if I had not noticed your blog post. Your main capability and kindness in taking care of every aspect was precious. I'm not sure what I would've done if I had not come across such a point like this. I am able to now relish my future. Thanks for your time very much for this impressive and amazing help. I will not be reluctant to endorse your web page to any person who should receive guidelines on this topic. off white jordan 1 [url=http://www.offwhitexjordan1.com]off white jordan 1[/url]
    匿名2018-06-13 09:01 回复
  21. I wanted to write you the bit of observation to be able to give thanks over again over the incredible suggestions you have provided above. It's simply extremely open-handed of you to make openly exactly what numerous people would have supplied for an ebook to earn some dough for their own end, precisely now that you could possibly have done it if you ever considered necessary. The strategies in addition served to be the easy way to know that someone else have the identical keenness much like my very own to grasp somewhat more pertaining to this matter. I think there are a lot more fun sessions in the future for people who read carefully your site. goyard bags [url=http://www.goyard-handbags.us.com]goyard bags[/url]
    匿名2018-06-13 23:44 回复
  22. My spouse and i felt quite relieved Emmanuel could finish up his reports with the ideas he came across using your web site. It's not at all simplistic to just find yourself giving freely key points that the others have been trying to sell. And now we recognize we need the blog owner to appreciate because of that. All the illustrations you made, the easy site menu, the relationships you can give support to create - it's most excellent, and it is leading our son in addition to the family believe that that content is cool, which is especially pressing. Thanks for all! adidas ultra boost [url=http://ux.nu/AhLz9]adidas ultra boost[/url]
    匿名2018-06-14 10:06 回复
  23. I just wanted to jot down a remark to be able to say thanks to you for these wonderful items you are placing on this site. My prolonged internet search has finally been paid with awesome facts and strategies to go over with my close friends. I would believe that many of us website visitors actually are quite fortunate to live in a superb website with very many brilliant professionals with good things. I feel very fortunate to have come across your webpage and look forward to tons of more excellent times reading here. Thanks again for everything. nike free run [url=http://www.nike-freerun.us.com]nike free run[/url]
    匿名2018-06-14 12:14 回复
  24. Thanks for your whole labor on this site. My aunt delights in managing investigation and it's simple to grasp why. My spouse and i hear all of the compelling mode you create practical secrets on the website and even boost response from website visitors on this concern so my daughter is undoubtedly becoming educated a whole lot. Take pleasure in the rest of the year. You are always doing a useful job. moncler jackets [url=http://www.monclerjackets.us]moncler jackets[/url]
    匿名2018-06-15 03:25 回复
  25. I simply wanted to thank you very much all over again. I am not sure the things I might have taken care of in the absence of these strategies provided by you about such situation. It became a real difficult difficulty in my view, but taking a look at your skilled approach you solved the issue made me to jump over gladness. I am just happier for your guidance and thus trust you know what a powerful job you have been doing training people today with the aid of your web site. I am sure you've never encountered all of us. adidas superstar uk [url=http://www.adidassuperstar.org.uk]adidas superstar uk[/url]
    匿名2018-06-15 15:48 回复
  26. I precisely wanted to thank you so much again. I'm not certain what I might have achieved without the actual opinions shared by you relating to such a area. It actually was a real frustrating problem in my view, however , looking at this expert tactic you dealt with that took me to leap over joy. I'm just thankful for the information and expect you are aware of a powerful job you're getting into training many people via your blog post. Most probably you have never encountered all of us. supreme clothing [url=http://www.supremeclothing.us]supreme clothing[/url]
    匿名2018-06-16 21:25 回复
  27. I intended to draft you a very small remark to finally thank you very much as before on your spectacular suggestions you have shown in this article. This has been incredibly generous of people like you giving without restraint what a few people would have made available for an e-book in order to make some bucks on their own, principally since you could possibly have tried it in the event you wanted. The principles in addition acted to become a fantastic way to comprehend the rest have a similar desire the same as mine to learn a whole lot more when it comes to this condition. Certainly there are millions of more enjoyable times ahead for individuals who look into your site. goyard handbags [url=http://www.goyardhandbags.us.com]goyard handbags[/url]
    匿名2018-06-17 10:08 回复
  28. I simply had to thank you so much once more. I'm not certain what I would've worked on in the absence of the entire strategies provided by you directly on this industry. It seemed to be the frightening scenario for me personally, however , observing your skilled fashion you managed the issue forced me to jump for joy. I am thankful for this support and in addition pray you find out what an amazing job that you are putting in educating some other people using a blog. Most probably you have never encountered any of us. nike air max 270 [url=http://www.nikeairmax270.org]nike air max 270[/url]
    匿名2018-06-18 02:23 回复
  29. I simply needed to appreciate you again. I am not sure what I could possibly have handled in the absence of the entire ideas discussed by you concerning this topic. It became a very alarming setting in my view, but being able to view a new specialised form you dealt with the issue made me to weep with contentment. Extremely thankful for the advice and as well , wish you comprehend what a powerful job that you are putting in instructing many others by way of your site. I'm certain you've never come across any of us. yeezy boost 350 [url=https://42.herber.pl/yzyboostus]yeezy boost 350[/url]
    匿名2018-06-18 06:11 回复
  30. I actually wanted to construct a simple word in order to thank you for some of the precious ways you are sharing at this website. My incredibly long internet investigation has at the end of the day been honored with good facts to talk about with my visitors. I would admit that many of us visitors are very blessed to live in a fantastic website with so many lovely people with valuable advice. I feel somewhat grateful to have seen your entire web page and look forward to plenty of more pleasurable minutes reading here. Thank you again for all the details. kate spade handbags [url=http://www.katespadehandbags-outlet.us.com]kate spade handbags[/url]
    匿名2018-06-18 12:57 回复
  31. I intended to compose you one little observation to be able to give thanks again for your personal spectacular advice you've featured in this article. It has been so remarkably generous with you to offer openly all that many people could have distributed for an electronic book to help with making some cash for themselves, notably since you could have done it if you decided. The things in addition served to be a good way to fully grasp that other individuals have the identical eagerness like my very own to realize a great deal more concerning this matter. I am certain there are a lot more fun situations up front for those who looked at your blog. oakley [url=http://www.oakleysunglassesonline.us.org]oakley[/url]
    匿名2018-06-20 07:09 (5天前)回复
  32. I simply desired to appreciate you all over again. I do not know the things I could possibly have undertaken without the actual opinions revealed by you directly on that problem. It had been a frustrating condition in my opinion, but noticing the well-written approach you managed it forced me to leap for delight. Now i'm grateful for your help and in addition believe you realize what an amazing job that you're putting in training some other people through your webpage. Most probably you haven't got to know all of us. ferragamo sale [url=http://www.ferragamobelt.us]ferragamo sale[/url]
    匿名2018-06-20 23:34 (5天前)回复
  33. I simply wished to thank you very much once more. I'm not certain the things that I would have handled without the entire methods documented by you on my area of interest. It has been the challenging dilemma for me, nevertheless witnessing a specialised form you solved the issue made me to weep for gladness. I'm happy for this advice as well as sincerely hope you realize what an amazing job you are always providing instructing others through your web page. I am certain you've never encountered any of us. ferragamo belt [url=http://www.ferragamobelt.us.org]ferragamo belt[/url]
    匿名2018-06-21 09:54 (4天前)回复
  34. Thanks a lot for providing individuals with such a remarkable possiblity to read critical reviews from this site. It is always so enjoyable and also full of amusement for me personally and my office acquaintances to search the blog a minimum of thrice every week to find out the newest secrets you will have. And definitely, I'm just at all times motivated with the astounding tips and hints served by you. Selected two areas on this page are unquestionably the most efficient we have all had. yeezy boost 350 v2 [url=http://onj.me/boostyeezy]yeezy boost 350 v2[/url]
    匿名2018-06-21 17:38 (4天前)回复
  35. I wanted to compose you the little bit of note to help give many thanks once again for the pleasing secrets you have contributed here. This has been simply incredibly open-handed of people like you to deliver publicly all that a few individuals could have advertised for an e book to help with making some cash on their own, notably now that you might have tried it in the event you wanted. The creative ideas in addition acted like the fantastic way to be aware that most people have similar dreams like my personal own to know the truth a whole lot more when considering this issue. I believe there are lots of more pleasurable instances up front for people who examine your website. cheap jordans [url=http://www.retro-jordans.us.com]cheap jordans[/url]
    匿名2018-06-22 09:11 (3天前)回复
  36. I simply wanted to thank you very much once again. I do not know the things that I would have used in the absence of the type of tricks shown by you directly on my concern. Previously it was a alarming scenario in my opinion, but looking at the well-written mode you resolved it took me to cry with fulfillment. I'm happy for the guidance and even hope you find out what a powerful job you happen to be carrying out teaching men and women through your site. More than likely you haven't met any of us. pandora jewelry [url=http://www.jewelrypandora.in.net]pandora jewelry[/url]
    匿名2018-06-22 23:46 (3天前)回复
  37. Thanks so much for providing individuals with an extremely nice possiblity to discover important secrets from this web site. It is usually very great and as well , jam-packed with fun for me and my office friends to visit your website at minimum three times in a week to read the newest items you will have. And lastly, I am also certainly motivated for the dazzling strategies you give. Selected 2 tips in this post are in reality the most impressive I've ever had. ranban sunglasses [url=http://www.raybanaviatorsunglasses.org]ranban sunglasses[/url]
    匿名2018-06-23 11:20 (2天前)回复
  38. I intended to create you that bit of note just to give thanks as before for these lovely methods you have documented here. It's wonderfully generous with you to grant publicly all many individuals could possibly have sold as an electronic book to help make some dough for their own end, precisely now that you might well have done it in the event you considered necessary. Those guidelines likewise served as the easy way to understand that the rest have the identical eagerness much like my personal own to figure out good deal more when it comes to this issue. I am sure there are lots of more fun situations in the future for many who go through your website. kyrie irving shoes [url=http://www.kyrieirving-shoes.us.com]kyrie irving shoes[/url]
    匿名2018-06-24 02:30 (2天前)回复
  39. I wish to show my appreciation for your generosity for those who should have help on this subject matter. Your personal commitment to passing the solution all through had been pretty good and have all the time allowed many people like me to arrive at their dreams. Your new important guide entails a whole lot to me and still more to my office colleagues. With thanks; from everyone of us. 100% real jordans for cheap [url=http://www.cheaprealjordans.us.com]100% real jordans for cheap[/url]
    匿名2018-06-24 13:38 (1天前)回复
  40. I wanted to develop a simple word to say thanks to you for all of the wonderful tricks you are showing on this site. My extended internet research has at the end been rewarded with incredibly good knowledge to exchange with my visitors. I would express that we website visitors actually are definitely endowed to dwell in a useful site with very many perfect individuals with good things. I feel pretty lucky to have come across your entire website page and look forward to so many more amazing times reading here. Thank you again for all the details. adidas yeezy boost [url=http://cbi.as/5bdod]adidas yeezy boost[/url]
    匿名2018-06-25 05:39 (12小时前)回复