Dedecms call Column name commonly used tags (sub column current column parent column)

Source: Internet
Author: User

Here's how to call the various column names:

1, {Dede:field name= "typename"} This is the name of the call current column
2. {dede:channel type= ' son ' row= ' 5 '} <a href= ' [field:typeurl/] ' >[field:typename/]</a> {/dede:channel} This is the call to the top channel all Word columns, row representative call 5
3. {dede:type typeid= ' column ID '} <a href= ' [field:typeurl/] ' >[field:typename/]</a> {/dede:type} ' indicates the column that invokes the specified ID. However, only one can be invoked, and multiple calls can only be repeated multiple times to call the label
4, {dede:channel type= ' top '}<a>[field:typename/]</a> {/dede:channel} call the current top-level column name of the child column

Here's how to invoke top-level column names:

Method One:

{Dede:field.typeid runphp= ' yes '} $ID = @me; $sql = "SELECT * from ' dede_arctype ' WHERE id= $ID"; $query = mysql_query ($sql); $row =mysql_fetch_array ($query); $relID = "$row [Reid]"; if ($relID = = 0) {@me = $row [TypeName];} else{$sql = "Select ' TypeName ' from ' Dede_arctype ' WHERE id= $relID"; $query = mysql_query ($sql); $row =mysql_fetch_array ($ query); @me = $row [TypeName];} {/dede:field.typeid}

This method statement is somewhat long.

The key recommendation method of dream-weaving two

Method Two:

{dede:field.title runphp= ' yes '}list ($toptype, $sontype) =split ('/', @me); @me = $toptype; {/dede:field.title}

Method Three:

{Dede:field.typeid runphp= ' yes '} $ID = @me; $sql = "SELECT * from ' dede_arctype ' WHERE id= $ID"; $query = mysql_query ($sql); $row =mysql_fetch_array ($query); $relID = "$row [Reid]"; $topID = "$row [Topid]"; if ($relID = = 0) {@me = $row [TypeName];} else{$sql = "Select ' TypeName ' from ' Dede_arctype ' WHERE id= $topID"; $query = mysql_query ($sql); $row =mysql_fetch_array ($ query); @me = $row [TypeName];} {/dede:field.typeid}

This method is improved, can be for the unlimited sub-column access to top-level columns, method one or two are targeted at level two column.

Call a sub column under the specified top-level column

<!--engineering construction-->

{dede:channelartlist typeid= ' 9,9 '}
<li><a href= "{dede:field name= ' typeurl '/}" class= "Nav1" >{dede : Field Name= ' TypeName '/}</a>
<div class= ' nav_2 '
{dede:channel ' type= ' son ' yes '}
noself= Href= "[field:typelink/]" >[FIELD:TYPENAME/]</A>
{/dede:channel}
<div class= "nav_2f" ></ Div>
</div>
</li>
{/dede:channelartlist}

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.