DEDECMS Global label channel| Channel label

Source: Internet
Author: User
Keywords DEDECMS global label channel label

channel| Channel Label

Label name: Channel
Tags introduction: Dream Weaving common mark, usually used for the top of the site to get the site column information, user-friendly website members to browse the whole station information
Function Description: To get the column list
Scope of application: global use
Basic syntax:
{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}
Related functions:
File \include\taglib\channel.lib.php Line 2nd
Function Lib_channel (& $ctag,& $REFOBJ)
Parameter description:
typeID = ' 0 ' column ID
Reid = ' 0 ' Superior column ID
row = ' 100 ' calls the number of columns
col = ' 1 ' in the number of columns displayed (default is a single column)
Type = ' son | Sun ' Son for subordinate columns, self for peer, top top-level
Currentstyle = ' Apply Style

Underlying template fields:

ID (same ID), typeID, Typelink, TypeName, Typeurl,typedir (only for column URL) example:

{dede:channel type= ' top '} <a href= ' [field:typelink/] ' >[field:typename/]</a> {/dede:channel}
Note: In the absence of specified typeid, the type tag is related to the environment of the template, for example, if the template is generated to column one, then Type= ' son ' represents all subclasses of column one
Usages:
This label is a global common tag, mainly used to display the column classification of the page, we can view the default template \templets\default\head.htm in the relevant code:
{dede:channel type= ' top ' currentstyle= ' <li class= ' thisclass ' ><a href= ' ~typelink~ ' >~typename~</a> </li> "}
<li><a href= ' [field:typeurl/] ' >[field:typename/]</a></li>{/dede:channel}
Here the column can be set through the background, column display order according to the level of ranking, we can in the system backstage [core]-[column Management] in the column settings:

Setup complete we can see the relevant effect at the top of the homepage

Of course, this involves a top-level column and child column display problems, we can use the corresponding tags in the template to call, we look at a cover page content:

We look at the template label for this article cover \templets\default\index_article.htm
<ul>
{dede:channel type= ' son ' currentstyle= "<li class= ' thisclass ' ><a href= ' ~typelink~" ><span>~ Typename~</span></a> </li> "}
<li><a href= ' [field:typeurl/] ' ><span>[field:typename/]</span></a></li>{/ Dede:channel}
</ul>
Here we use the type= ' son ' attribute to display the sub columns.

Many users want the top navigation connection easy to SEO, need to remove "index.html" in the hyperlink, we can make a change to the label here:
{dede:channel type= ' top '}
<li><a href= ' [Field:typeurl function= ' Str_replace ("index.html", "", @me) '/] ' >[field:typename/]</a ></li> {/dede:channel}

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.