search
HomeCMS TutorialDEDECMSHow to modify the TITLE tag on the DEDECMS web page

How to modify the TITLE tag on the DEDECMS web page

How to modify the TITLE tag of DEDECMS web page?

DEDECMS web page TITLE tag modification is conducive to optimization

It is said that Baidu is basically We don’t even look at the keyword (of course we have to write it), but the key now is the title on the web page. So be sure to do a good job with the title. It mainly involves the issue of how to implement "third-level column_second-level column_first-level column_website name". Nowadays, the titles of most websites are basically like this:

Recommended learning: 梦Weavercms

Home page:

{dede:global.cfg_webname/}, in "System Settings" → "Basic System Parameters", write the title information of the homepage in the website name.

Column page:

Find around line 164 of include/typelink.class.php, find

$this->valuePositionName = $tinfos['typename'].$this->SplitSymbol.$this->valuePositionName;

and modify it to:

$this->valuePositionName = $this->valuePositionName.$this->SplitSymbol.$tinfos['typename'];

Next, add the list The default title tag

<title>{dede:field.title/} - {dede:global.cfg_webname/}</title>

on the page template can be changed to:

<title><title>{dede:field.优化title /} {dede:field.title function=&#39;ereg_replace(" - "," - ",@me)&#39;/} - {dede:global.cfg_webname/}</title>

.

The first tag {dede:field.optimized title /} is the optimized title of the calling column. If you are not satisfied with the connector in the middle of the column, you can modify include/arc.listview.class.php, find line 55

$this->Fields[&#39;title&#39;] = ereg_replace("[<>]"," / ",$this->TypeLink->GetPositionLink(false));

, delete / and be sure to leave a space" "

Article page :

<title>{dede:field.优化title/} {dede:field name=&#39;title&#39;/}-{dede:field name=&#39;position&#39; runphp=&#39;yes&#39;} 
$tc="-"; //分隔符 
$tw=$GLOBALS[&#39;cfg_list_symbol&#39;]; //调用位置分隔符 
@me=html2text(@me); //去除html标签 
$tf=split($tw,@me); //分解成数组 
for($ta=(count($tf)-2);$ta>=1;$ta--){ //循环赋值给$tk 
$tk.=trim($tf[$ta]).$tc; 
} 
$tk=substr($tk,0,-1); 
@me=$tk; //赋值给@me 
{/dede:field}-{dede:global name=&#39;cfg_webname&#39;/}</title>

Effect: Realize "third-level column_second-level column_first-level column_website name". What is the abbreviated title {dede:field.optimized title/} used for? That’s right—long-tail keywords.

The above is the detailed content of How to modify the TITLE tag on the DEDECMS web page. For more information, please follow other related articles on the PHP Chinese website!

Statement
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

Video Face Swap

Video Face Swap

Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Tools

SublimeText3 English version

SublimeText3 English version

Recommended: Win version, supports code prompts!

mPDF

mPDF

mPDF is a PHP library that can generate PDF files from UTF-8 encoded HTML. The original author, Ian Back, wrote mPDF to output PDF files "on the fly" from his website and handle different languages. It is slower than original scripts like HTML2FPDF and produces larger files when using Unicode fonts, but supports CSS styles etc. and has a lot of enhancements. Supports almost all languages, including RTL (Arabic and Hebrew) and CJK (Chinese, Japanese and Korean). Supports nested block-level elements (such as P, DIV),

SublimeText3 Mac version

SublimeText3 Mac version

God-level code editing software (SublimeText3)

MinGW - Minimalist GNU for Windows

MinGW - Minimalist GNU for Windows

This project is in the process of being migrated to osdn.net/projects/mingw, you can continue to follow us there. MinGW: A native Windows port of the GNU Compiler Collection (GCC), freely distributable import libraries and header files for building native Windows applications; includes extensions to the MSVC runtime to support C99 functionality. All MinGW software can run on 64-bit Windows platforms.

Atom editor mac version download

Atom editor mac version download

The most popular open source editor