dedecmsHow to modify the English website?
Many domestic netizens choose Dreamweaver to build English websites. In fact, Dreamweaver is indeed very powerful, but I personally recommend using more mature foreign CMS or WP, but some users are already used to it. I have used Dreamweaver, and the collection is relatively easy, so I shared this article about the changes that need to be made using Dreamweaver, that is, dedecms, to build an English website.
Recommended learning: 梦Weavercms
The first step is coding:
It is to install dede of utf-8... Then find an English template in the dede forum.
After installing it, look at the front desk. It has become an English version.
Start making the template. You can imitate the English website.
There are several points to note when making templates:
1. Character set issue: charset=utf-8
2. Use Verdana, Arial, Helvetica, sans-serif as fonts. Such fonts look better in English
3. Do not allow Chinese characters, such as full-width spaces, to appear on all pages
4. Page layout, details, etc. must conform to the habits of foreigners
For example: the time format is "month-day-year", the corresponding dede tag is: [field:pubdate function=strftime('%m-%d-%Y',@me)/]
5. SEO details
(1) URL processing of articles
Everyone should know that Google attaches great importance to URL addresses. For the same article titled old food new tricks, if The URL displayed as http://www.xxx.com/list1/20070928/5104.html is obviously not as high as http://www.xxx.com/list1/old-food-new-tricks.html. The default page address generated by dede is the former. How to change the display type to the latter?
Enter the backend and modify the article naming rules of the column. The default is: {typedir}/{Y}{M}{D}/{aid}.html
Modify to: {typedir }/{pinyin}.html I removed {Y}{M}{D}, which reduces the level of the article and is conducive to engine inclusion.
For specific modification methods, please refer to the following:
As the title states, use dede to make the article title page display the path as title pinyin.html, for example: the article title is: What is Zhanyou.com, article The path is displayed: zhanyouwangshishenmea.html. What are the benefits of displaying it this way? Damn, do I even need to say this?
Method:
Select: Website column management, modify the advanced options of the column, article naming rules: {typedir}/{Y}{M}{D}/{aid}.html this It is the default state
Modified to: {typedir}/{pinyin}.html I think {Y}{M}{D} is useless, so I removed it.
Update again and see if it has any effect?
Don’t worry, the pinyin is now displayed, zhanyouwangshishenmea_1.html, but there is an extra _1 at the end. How to remove this?
Modify the inc_channel_unit_function file in include and find $articleRule = str_replace("{pinyin}",GetPinyin($title)."_".$aid,$articleRule); put."_".$aid Just remove it and that’s it!
If the article title is in English, _ will be added between the words, but adding _ in the middle of the word has no meaning for gg. It must be changed to "-". The modification method is as follows
Open include/inc/inc_fun_funAdmin.php
for($i=0;$i<$slen;$i++){ if(ord($str[$i])>0x80) { $c = $str[$i].$str[$i+1]; $i++; if(isset($pinyins[$c])){ if($ishead==0) $restr .= $pinyins[$c]; else $restr .= $pinyins[$c][0]; }else $restr .= "-"; }else if( eregi("[a-z0-9]",$str[$i]) ){ $restr .= $str[$i]; } else{ $restr .= "-"; } }
Change
$restr .= "-"; These things
Add "-" in the middle of pinyin
Modify include\inc\inc_fun_funAdmin.php
for($i=0;$i<$slen;$i++){ if(ord($str[$i])>0x80) { $c = $str[$i].$str[$i+1]; $i++; if(isset($pinyins[$c])){ if($ishead==0) $restr .= $pinyins[$c]."-" ; if($isclose==0) unset($pinyins); if(substr($restr,-1)=="-") $restr = substr($restr,0,strlen($restr)-1); return $restr;
Red is newly added
(2) Meta processing
I modified the meta of article_article.htm to:
<meta name="description" content="{dede:field name="title"/} {dede:field name='description' /}"> <meta name="keywords" content="{dede:field name='keywords' /} {dede:field name="title"/}">
Note that there must be a space between tags, otherwise the following ones will not work
After this modification, the meta of each article will be different
list_article.htm The meta I want to implement is
<meta name="description" content="{dede:field name='description' /}"> <meta name="keywords" content="{dede:field name='keywords' /}">
The above is the detailed content of How to modify dedecms' English website. For more information, please follow other related articles on the PHP Chinese website!