DedeCMS column page calls the current column name and the superior column name

       When building a web page, if you do not want to write the title of the column list page one by one, the title of the list page is in the form of: {field:seotitle/}_{dede:global.cfg_webname/}, where {field:seotitle/} is the column list seo title.

       Especially the multi-layer column list page can use the form of: secondary column name_first-level column name_website name, while the content page should be in the form of: article title_secondary column name_first-level column name_website name form.

       Of course, this way of writing is more suitable for websites with a simpler structure. In fact, each column needs to be written with a separate seo title, there is no limitation, and it is also conducive to the formation of keywords.

       Let's see that the dedecms list page can directly call the superior column name and get the current column name as the title without modifying php.

Get the current column name

{dede:type}[field:typename/]{/dede:type}

Get the name of the superior column

{dede:field.typeid runphp='yes'"}
   global $dsql ;
   $reid = $dsql->GetOne("SELECT reid FROM dede_arctype where id=@me");
   $reid = $reid['reid'];
   $typename = $dsql->GetOne("SELECT typename FROM dede_arctype where id=$reid");
   @me=$typename['typename'];
{/dede:field.typeid}

List page full column headings are written as follows

 <title>
{dede:field.typeid runphp='yes'"}
  global $dsql ;
  $reid = $dsql->GetOne("SELECT reid FROM dede_arctype where id=@me");
  $reid = $reid['reid'];
  $typename = $dsql->GetOne("SELECT typename FROM dede_arctype where id=$reid");
  @me=$typename['typename'];
{/dede:field.typeid}_{dede:type}[field:typename/]{/dede:type}-{dede:global.cfg_webname/}
</title>

Content page or article page title writing

      Just add {field:title/} in front, and you won't be tired.

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=324771028&siteId=291194637