dedecms list page and content page how to call the top column ID?
dedecms list page and content page call the top level Column ID method
Recommended learning: 梦Weaving cms
Summary of the method of adding top column id in dede dreamweaving template, using dede top column id can achieve many functions For example: calling different column images on each list page (the same top-level column calls the same image), if we make N columns, it means making N list page templates, and this method is not advisable;
So how can we deal with this problem faster and easier? The idea of dede template is as follows: call the top column ID, and then add the end of the picture as the ID number, such as: img1.jpg, which is imgID.jpg. We just need to make pictures; that’s what it means. The following is the method collected by Dream Weaver on the Internet:
dede calls the top column ID. Method one:
{dede:field.typeid function="GetTopid(@me)"/}
Dreamweaver recommends this method, and it is feasible after testing
dede calls the top column ID Method 2:
First, where Where you need to call the top-level column ID, add this tag syntax
{dede:type}[feild:topid/]{/dede:type}
Second, modify the source file and find type.lib.php in the taglib directory under the include directory.
Find this statement
$row = $dsql->GetOne(“Select id,typename,typedir,isdefault,ispart,defaultname,namerule2,moresite,siteurl,sitepath From `dede_arctype` where id=’$typeid’ “);
Modify it to
$row = $dsql->GetOne(“Select id,topid,typename,typedir,isdefault,ispart,defaultname,namerule2,moresite,siteurl,sitepath From `dede_arctype` where id=’$typeid’ “);
Add
if( $row['topid']==0){$row['topid']=$row['id'];}
like this in the next line of if(!is_array($row)) return ”; , this statement can be called in either the top-level column or a sub-column.
The above is the detailed content of How to call the top column ID on dedecms list page and content page. For more information, please follow other related articles on the PHP Chinese website!