The method for adding top-level topic IDs in the Zhimeng template is summarized. using dede top-level topic IDs can achieve many functions, such: call different topic images on each list page (the same picture is called for the same top-level topic ),
The method for adding top-level topic IDs in the Zhimeng template is summarized. using dede top-level topic IDs can achieve many functions, such: call different column pictures on each list page (the same picture is called for the same top-level column). if we create N columns, we need to create N List page templates, this method is not desirable. how can we solve this problem faster and more simply? the idea of the dede template is as follows: call the top-level column ID, then add the image tail as the ID number, for example, img1.jpg, that is, imgid.jpg. in this case, we only need to create an image. this is probably the case, the following describes how php exclusive network collects data on the network:
Dede Method 1:
{dede:field.typeid function="GetTopid(@me)"/}
This method is feasible after testing.
Dede Method 2:
First, add the tag syntax where you need to call the top-level topic ID.
{dede:type}[feild:topid/]{/dede:type}
Second, modify the source file and find type. lib. php under the taglib directory under the include directory.
Find this statement
$row = $dsql->GetOne(“Select id,typename,typedir,isdefault,ispart,defaultname,namerule2,moresite,siteurl,sitepathFrom `dede_arctype` where id=’$typeid’ “);
Changed
$row = $dsql->GetOne(“Select id,topid,typename,typedir,isdefault,ispart,defaultname,namerule2,moresite,siteurl,sitepathFrom `dede_arctype` where id=’$typeid’ “);
In if (! Is_array ($ row) return "; add the following row
if( $row['topid']==0){$row['topid']=$row['id'];}
In this way, this statement can be called in top-level columns or subcolumns.
This method looks good and you can modify the source code. However, after my test, I found that it didn't achieve the desired effect, so I didn't use it. if you are interested, you can test whether it is feasible.
The above is a small summary of how php lexnet adds the top-level topic id to the dede dream template. You are welcome to test and pay attention to it. if you have any new methods, please share them, you can leave a message in my comments.