2 ways to solve the problem of Dedeeims label cannot be nested in detail

Source: Internet
Author: User
This article mainly introduces the weaving Dream Dedeeims label can not be nested 2 kinds of solutions, that is, dede tag nested another Dede label can not resolve the problem of normal resolution method, the need for friends can refer to the following label:

The code is as follows:

{dede:list pagesize= ' 6′}<li><a href= "/plus/jobs.php?lang={dede:global.user_lang/}&jobid=[field:id/] ">[field:jobname/]</a></li>{/dede:list}


When running, found {dede:global.user_lang/} Incredibly intact was shown out without being parsed, I am very puzzled, so went to the online search on the dedecms can not Nest label solution, and finally found two solutions.

Programme one:

<!– before the label, first use JS to get the contents of the tag –><script type= "Text/javascript" >function Get_user_lang () {  document.write ("{dede:global.user_lang/}");} </script>{dede:list pagesize= ' 6′}<!– then call the JS function in the tag to show the contents –><li><a href= "/plus/jobs.php?lang =<script type= "Text/javascript" >get_user_lang (); </script>&jobid=[field:id/] ">[field:jobname/ ]</a></li>{/dede:list}


Obviously, this approach is certainly not what I want, because the method is not only complex, and not easy to maintain, more importantly, I try to adhere to the behavior and structural separation of the habit contrary, and then search on the Internet, the results found a more convenient solution, that is, {dede:global.user_lang/} Change to [field:global.user_lang/].

Scenario Two:

{dede:list pagesize= ' 6′}<li><a href= '/plus/jobs.php?lang=[field:global.user_lang/]&jobid=[field:id/ ] ">[field:jobname/]</a></li>{/dede:list}

Dedecms template Download Address: www.php.cn/xiazai/code/dedecms

Is it very simple, the method is not only simple, but easy to maintain, but also in line with the good habits of structure and behavior separation, of course, the application of other labels or in the DEDECMS is also applicable.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.