Home  >  Article  >  Backend Development  >  How to correctly highlight the current navigation in template inheritance? (Waiting online...)

How to correctly highlight the current navigation in template inheritance? (Waiting online...)

WBOY
WBOYOriginal
2016-10-22 00:00:181186browse

How to correctly highlight the current navigation in template inheritance? (Waiting online...)

Similar to the navigation above, I used the principle of template inheritance to define a base.html file in thinkphp, which contains the general header, nav navigation, and footer bottom. Other html files will inherit this base.html template.

  • How can I highlight the navigation corresponding to the current page when visiting other pages?

  • As shown in the picture above, when I visit the actual page, how can I highlight the navigation corresponding to the current page, if the navigation is a multi-level navigation?

  • When I visit the sub-navigation corresponding to the main navigation, how can I correctly highlight the main navigation on the sub-navigation of the corresponding page?

Waiting online, I hope all my friends can help me with my doubts.

Statement:
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