When building a website using EmpireCMS, many administrators encounter the issue of modifying the website title. The default title format might not meet individual needs, so it is necessary to customize the website title. In this article, we will provide detailed code examples to help you modify the EmpireCMS title and enhance your website's user experience and SEO effectiveness.
First, log in to the EmpireCMS backend management system, go to the "Website Settings" page, find "Basic Settings", and then modify the "Website Name" option. By default, the website title is displayed in the format "{$webname} - {$description}". If you need a more personalized title, you can refer to the following code examples for modification.
{
if
$article
.Category.Id==1}
$webname
}
{/
if
}
{
if
$article
.Category.Id==2}
$webname
}
{/
if
}
{
if
$article
.Category.Id==3}
$webname
}
{/
if
}
This code example allows you to modify the website title based on the category ID of the current page, providing different titles for different pages.
{assign
var
=
'currentPage'
value=
$arctitle
}
{
if
$currentPage
eq
'Home'
}
$webname
}
{
elseif
$currentPage
eq
'About Us'
}
$webname
}
{
elseif
$currentPage
eq
'Product Center'
}
$webname
}
{
else
}
$webname
}
{/
if
}
This example shows how to set a specific title for each page, ensuring that the website title matches the page name for a better user experience and improved SEO.
With the two code examples above, you can easily customize the website title in EmpireCMS. Based on your page requirements, you can choose the method that best suits your needs for personalized title settings. We hope these solutions help you manage and optimize your EmpireCMS website's title.