Home > Article > Backend Development > Difficulties in modifying the title of the Imperial CMS website? See the suggestions here!
Difficulties in modifying the title of the Empire CMS website? See the suggestions here!
In the process of using Empire CMS to build a website, many webmasters encounter a common question: How to modify the website title? The default title format of Empire CMS may not meet the needs of some users, so the website title needs to be customized. This article will introduce how to modify the title of the Imperial CMS website through code examples to make your website more personalized.
First, log in to the backend management system of Empire CMS, find "Basic Settings" in "Website Settings", and find the "Website Name" option there. By default, the website name is displayed in the format of "{$webname} - {$description}". If you want to customize the website title, you can refer to the code example below to modify it.
Code Example 1: Modify the website title
{if $article.Category.Id==1} <title>首页 - {$webname}</title> {/if} {if $article.Category.Id==2} <title>关于我们 - {$webname}</title> {/if} {if $article.Category.Id==3} <title>产品中心 - {$webname}</title> {/if}
In the above example, different website titles are set by judging the column ID to which the current page belongs, so that different titles can be displayed according to different pages. Effect.
Code Example 2: Modify the website title
{assign var='currentPage' value=$arctitle} {if $currentPage eq '首页'} <title>网站首页 - {$webname}</title> {elseif $currentPage eq '关于我们'} <title>关于我们 - {$webname}</title> {elseif $currentPage eq '产品中心'} <title>产品中心 - {$webname}</title> {else} <title>未命名页面 - {$webname}</title> {/if}
By setting a specific title for each page, the effect of displaying the website title according to the page name is achieved.
The above are two ways to modify the title of the Empire CMS website through code examples. You can choose one of them to modify according to your own needs. I hope the above content will be helpful to you and allow your Imperial CMS website to have a more personalized title display.
The above is the detailed content of Difficulties in modifying the title of the Imperial CMS website? See the suggestions here!. For more information, please follow other related articles on the PHP Chinese website!