Sometimes we will call the list page or the Content Detail page designated top-level column name and link, try a lot of methods, some can only call all top-level columns or sub-columns below the channel, it is very confusing. Let's talk about the method of calling the various column names:
1, {Dede:field name= "typename"} This is the name of the calling 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 the word column, row represents the call 5
3, {dede:type typeid= ' column ID '} <a href= "[field:typeurl/]" >[field:typename/]</a> {/dede:type} represents the column that invokes the specified ID, However, only one can be called, 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 sub-column of the current top-level column name
Here's how to invoke the top-level column name:
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 Weaver Dreamer II
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 infinite sub-column to obtain top-level columns, method one or two is for two columns.
A method of invoking the name of a specified top-level column or current sub-column