Dedecms Current Column Highlighting method

Source: Internet
Author: User

In the Dedecms template how to implement the navigation bar in the current column style and non-current columns, that is, the current column highlighting? If the page is the current section of the page, for example, the navigation is:

These five navigation sections, then when I browse < company profile > This section < Company profile > highlighted in the navigation bar such as:

Home, company profile, company news, product Center, contact Us

or use a different CSS style, like: The background changed to red, not the current column to use another CSS style. How does this function be implemented?

1: Preferred We will look at the use of (channel) Tags:

Label name: Channel

Tags introduction: Weaving dream commonly used tags, usually for the top of the site to get site column information, convenient site members browse the whole station information function Description: For the field list to obtain the scope of application:

Use basic syntax globally:

{dede:channel type= ' top ' row= ' 8 ' currentstyle= "<li><a href= ' ~typelink~ ' class= ' ThisClass ' >~typename~ </a> </li> "}

<li><a href= ' [field:typelink/] ' >[field:typename/]</a>

</li>

{/dede:channel}

Parameter description: typeID = ' 0 ' column ID

Reid = ' 0 ' Superior column ID

row = ' 100 ' Call number of columns

col = ' 1 ' of how many columns are displayed (default is single column)

Type = ' son | Sun ' Son is a subordinate column, self means the same level column, top top column

Currentstyle = ' Apply Style '

class= ' ThisClass ' ThisClass This is free, he stands for the style sheet inside, the highlighted style you give.

Underlying template field: ID (same ID), typeID, Typelink, TypeName, Typeurl,typedir (only for column URLs)

Example: {dede:channel type= ' top '}<a href= ' [field:typelink/] ' >[field:typename/]</a>{/dede:channel}

Note: If typeID is not specified, the type tag is related to the environment of the template, for example, when the template is generated to column one, then Type= ' son ' represents all subclasses of column one.


Take a look at the navigation section of my Dedecms template code:

<DIVclass=menu>

<UL>

<li><ahref= "/" > Home </A></LI>

{dede:channel type= ' self ' row= ' 8 ' currentstyle= ' <liclass=hover><ahref=~typelink~>~typename~</a> </li> "}

<li><ahref= ' [field:typelink/] ' >[field:typename/]</a></LI>

{/dede:channel}

</UL>

</DIV>

So the hover we have in the stylesheet is the style that controls highlighting:

There's not much to write about in menu{.}

. menu ul{There is not much to write about}

. menu UL li{there is not much to write about}

. menu ul Li a{there is not much to write about}

. Hover{background:url (Bg-nav.jpg) no-repeat;}

The above section is the top navigation menu for my page, where Currentstyle is used to highlight the current column. Class=hover nature is my definition of the current column style!


Here is related to the Dedecms label problem, in fact, familiar with the Dedecms label classmate on this issue will not be embarrassed, the following is the official channel of Dedecms label (that is, the navigation bar with

) Description: Where the class= ' ThisClass ' ThisClass is the CSS style category name (class, category selector) you defined, the application is changed to the class you defined.

Class= ' ThisClass ' is placed in the <a> tag, the CSS style acts on <a>, or it can be placed in the <li> tag for <li> markup.

Dedecms Current Column Highlighting method

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.