How to use custom tags in cms to achieve the effect of [!-- newsnav--]
How to use custom tags in cms to achieve the effect of [!-newsnav--]? I believe that many inexperienced people are at a loss about this, so this article summarizes the causes and solutions of the problem. Through this article, I hope you can solve this problem.
Want to modify [!-- newsnav--] for example, want to remove the link of "Home > Jinhu Station > Water Conservancy News" and the big column "Jinhu Station" to modify the e/class/connect.php file, ReturnClassLink () this method.
Here is a custom tag to achieve the effect of [!-- newsnav--]. If you want to modify it, it is easy to do so.
Step 1: add the following function to e/class/userfun.php, which takes only one argument, the current ID
/ / current location navigation function user_linknav ($classid) {global $empire,$dbtbpre; $query= "select classname,bclassid,classpath from {$dbtbpre} enewsclass where classid=". $classid; $sql=$empire- > query ($query); / / echo "Home Page"; while ($ringing empires-> fetch ($sql)) {findparent ($r [breadd]) Echo ">". $r [classname]. ";} / / current location navigation, recursively query parent column function findparent ($classid) {global $empire,$dbtbpre; $query=" select classname,bclassid,classpath from {$dbtbpre} enewsclass where classid= ". $classid; $sql=$empire- > query ($query) While ($ritual empires-> fetch ($sql)) {findparent ($r [bounded]); echo ">". $r [classname]. ";}}
Step 2: add the tag in the module management. The tag symbol is linknav, the function name is user_linknav, and the format of the tag is [linknav] column ID [/ linknav].
Step 3: add the template variable nav, which reads "your current location: [linknav] $globals [navy] [/ linknav]"
At the end. You just need to call the template variable [!-- temp.nav--] in the template. The specific style can be put in a div [!-- temp.nav--]. Then set the style of div, or you can modify the functions under userfun. The function is simple. Is to query recursively according to the current column.
After reading the above, do you know how to use custom tags in cms to achieve the effect of [!-newsnav--]? If you want to learn more skills or want to know more about it, you are welcome to follow the industry information channel, thank you for reading!