Ecshop Full site custom title title

Source: Internet
Author: User

For the SEO, can let the title customization will greatly increase the SEO effect, improve the flow of independent mall, today's small compilation on the collection from the Internet to ecshop all the site custom code, very full Oh!

1, Ecshop Product Classification page How to implement the custom titleRecently found a lot of people are looking for "how to customize the Ecshop Product Classification page (List page) TITLE" Method of modification. A two-time development tutorial is provided below. 1th step, modify the structure of the Ecs_category data table, add a new field
into the background "database management" SQL query, execute the following SQL statement
ALTER TABLE ' ecs_category ' ADD ' cat_title ' VARCHAR (255) notnullafter ' Cat_desc ';2nd step,
Open the background template file admin/templates/category_info.htm (preferably open with editplus) to find the following code<tr><td class= "label" >{$lang .keywords}:</td><td><input type= "text" name= "keywords" value= ' {$cat _info.keywords} ' size= ' ></td></tr>
Above it to add<tr><td class= "label" > Custom title:</td><td><input type= "text" name= "Cat_title" value= ' {$cat _info.cat_title} ' size= ' ></td></tr>3rd step, continue to open the file admin/category.php
Find the following code$cat [' cat_desc '] =!empty ($_post[' Cat_desc ')? $_post[' Cat_desc ']: ';
You can find two places in total, add code behind each place$cat [' cat_title '] =!empty ($_post[' Cat_title ')? $_post[' Cat_title ']: ';4th step,
Below to modify the foreground program file/category.php
Found itreturn $GLOBALS [' DB ']->getrow (' SELECT cat_name, keywords, cat_desc, style, grade, filter_attr, parent_id from '. $ globals[' ECS ']->table (' category ').
Change the revision toreturn $GLOBALS [' DB ']->getrow (' SELECT cat_name, cat_title, keywords, cat_desc, style, grade, filter_attr, parent _id from '. $GLOBALS [' ECS ']->table (' category ').5th step, continue to find
$smarty->assign (' page_title ', $position [' title ']);
Change it to $smarty->assign (' Page_title ', $cat [' Cat_title ']? $cat [' Cat_title ']: $position [' title ']); custom content displays customizations. No, the default is displayed. How to use: Enter backstage "Commodity management" commodity classification, edit a classification can be. 2. Ecshop article category List page How to customize titleThe article on "Product List page, product detail page How to customize title" has been the tutorial, but did not explain "Article classification list page How to customize title". The following is a ecshop2.7.2 version of the official default template based on the explanation. 1), first we to modify the database structure, to the data table Ecs_article_cat add a field "Page_title" into the Ecshop backstage "database Management" SQL query, enter the following SQL statement, and submit. Note The data table prefix here, which I use as the default prefix.ALTER TABLE ' ecs_article_cat ' ADD ' page_title ' VARCHAR (255) not NULL2), modify background templates and programs open/admin/templates/articlecat_info.htm find<tr><td class= "label" >{$lang .sort_order}:</td>
Add the following code snippet in front of it
<tr><td class= "label" > Custom title:</td> <td><input type= "text" name= "Page_title" value= "{$cat. Page_title|escape}" size= " /></td></tr>

Then open/admin/articlecat.php will$sql = "INSERT into". $ecs->table (' Article_cat '). " (Cat_name, Cat_type, Cat_desc,keywords, parent_id, Sort_order, Show_in_nav)VALUES (' $_post[cat_name] ', ' $cat _type ', ' $_post[cat_desc ', ' $_post[keywords] ', ' $_post[parent_id ', ' $_po St[sort_order] ', ' $_post[show_in_nav] ') ";
Revision changed to$sql = "INSERT into". $ecs->table (' Article_cat '). " (Cat_name, Cat_type, Cat_desc,keywords, parent_id, Sort_order, Show_in_nav,page_title)VALUES (' $_post[cat_name] ', ' $cat _type ', ' $_post[cat_desc ', ' $_post[keywords] ', ' $_post[parent_id ', ' $_po St[sort_order] ', ' $_post[show_in_nav] ', ' $POST [Page_title] ');
Continue, will$sql = "Select cat_id, Cat_name, Cat_type, Cat_desc, Show_in_nav, keywords, parent_id,sort_order from".$ecs->table (' Article_cat '). "WHERE cat_id= ' $_request[id] '";
Revision changed to$sql = "Select cat_id, Cat_name, Cat_type, Cat_desc, Show_in_nav, keywords, parent_id,sort_order,page_title from". $ecs->table (' Article_cat '). "WHERE cat_id= ' $_request[id] '";
Continue down theif ($exc->edit ("Cat_name = ' $_post[cat_name] ', Cat_desc = ' $_post[cat_desc] ', keywords= ' $_post[keywords] ', parent_id = ' $_post[parent_id] ', cat_type= ' $cat _type ', sort_order= ' $_post[sort_order] ', Show_in_nav = ' $_POST[show_in _nav] ' ", $_post[' id ') )
Revision changed toif ($exc->edit ("Cat_name = ' $_post[cat_name] ', Cat_desc = ' $_post[cat_desc] ', keywords= ' $_post[keywords] ', parent_id = ' $_post[parent_id] ', cat_type= ' $cat _type ', sort_order= ' $_post[sort_order] ', Show_in_nav = ' $_POST[show_in _nav] ', page_title= ' $_post[page_title] ' ", $_post[' id ') )
3), modify the article List page foreground program
Open a article_cat.php file to find$meta = $db->getrow ("Select keywords, cat_desc from". $ecs->table (' Article_cat '). "WHERE cat_id = ' $cat _id '");Revision changed to$meta = $db->getrow ("Select keywords, cat_desc,page_title from". $ecs->table (' Article_cat '). "WHERE cat_id = ' $cat _id '");Found it$smarty->assign (' keywords ', htmlspecialchars ($meta [' keywords ']);Add a line of code underneath it$smarty->assign (' Page_title ', Htmlspecialchars ($meta [' page_title ']); 3, about Ecshop brand page How to customize the title methodLess gossip, the following is the 2.7.2 official default template for an example of how to customize the title on the Ecshop brand page. 1), the first step, modify the database structure, add a new field in the Ecs_brand table page_title into the background "database management" SQL query, enter the following SQL statement, and execute.ALTER TABLE ' ecs_brand ' ADD ' page_title ' VARCHAR (255) not NULLNote: My database is the default prefix, please modify it for your database prefix. 2), the second step, modify the template file/admin/templates/brand_info.htm<tr><td class= "label" >{$lang .sort_order}</td><td><input type= "text" name= "Sort_order" maxlength= "All" size= "" value= "{$brand. Sort_order}"/>< /TD></tr>Add below<tr><td class= "label" > Custom title:</td><td><input type= "text" name= "Page_title" size= "value=" {$brand. Page_title} "/></td></tr>3), modify the/admin/brand.php file found (about 88 rows or so)$sql = "INSERT into". $ecs->table (' brand '). " (Brand_Name, Site_url, Brand_desc, Brand_logo, Is_show, Sort_order) "."VALUES (' $_post[brand_name] ', ' $site _url ', ' $_post[brand_desc] ', ' $img _name ', ' $is _show ', ' $_post[sort_ord ER] ');$db->query ($sql);Fix it to$sql = "INSERT into". $ecs->table (' brand '). " (Brand_Name, Site_url, Brand_desc, Brand_logo, Is_show, Sort_order,page_title) "."VALUES (' $_post[brand_name] ', ' $site _url ', ' $_post[brand_desc] ', ' $img _name ', ' $is _show ', ' $_post[sort_ord ER] '), ' $_post[page_title] ';$db->query ($sql);Continue to find (about 113 rows or so)$sql = "Select brand_id, Brand_Name, Site_url, Brand_logo, Brand_desc, Brand_logo, Is_show, Sort_order"."from". $ecs->table (' brand '). WHERE brand_id= ' $_request[id] ' ";$brand = $db->getrow ($sql);Change the revision to$sql = "Select brand_id, Brand_Name, Site_url, Brand_logo, Brand_desc, Brand_logo, Is_show, Sort_order,page_title". /c3>"from". $ecs->table (' brand '). WHERE brand_id= ' $_request[id] ' ";$brand = $db->getrow ($sql);Continue down to find/ * Process Pictures * /$img _name = basename ($image->upload_image ($_files[' Brand_logo '], ' Brandlogo '));$param = "Brand_Name = ' $_post[brand_name] ', site_url= ' $site _url ', brand_desc= ' $_post[brand_desc] ', is_show= ' $is _ Show ', sort_order= ' $_post[sort_order] ' ";Modify it to the following code/ * Process Pictures * /$img _name = basename ($image->upload_image ($_files[' Brand_logo '], ' Brandlogo '));$param = "Brand_Name = ' $_post[brand_name] ', site_url= ' $site _url ', brand_desc= ' $_post[brand_desc] ', is_show= ' $is _ Show ', sort_order= ' $_post[sort_order] ', page_title= ' $_post[page_title] ' ";4), modify the foreground program file/brand.php will$smarty->assign (' page_title ', $position [' title ']); Page TitleRevision changed to$smarty->assign (' Page_title ', Htmlspecialchars ($brand _info[' page_title ')); Page Title5), finished, you can see the effect. 4. Ecshop Product Detail Page Custom title methodModify the modified file that is involved in the tutorial/admin/templates/goods_info.htm/admin/goods.php/goods.php
Modify steps: 1: Run SQL statements in the background, admin background, left navigation, database management->sql query run the following statement (only once, be careful):ALTER TABLE ecs_goods add seo_title text NOT null
2: Modify admin/templates/goods_info.htm after the 44th line of this file, add the following lines<tr><td class= "label" > Custom title</td><td>
<input type= "text" name= "Seo_title" value= "{$goods. Seo_title}" size= " />
</td>
</tr>
3: Modify admin/goods.php Search "Rank_integral" in the SQL statement there modify, need to modify everywhere, in 833 rows to find"Is_on_sale, Is_alone_sale, is_shipping, Goods_desc, Add_time, Last_update, Goods_type, Rank_integral, Seo_title, suppliers_id) ".Modified into"Is_on_sale, Is_alone_sale, is_shipping, Goods_desc, Add_time, Last_update, Goods_type, Rank_integral, Seo_title, suppliers_id) ".Find 839 rows to find"' $_post[goods_desc] ', '". Gmtime (). "‘, ‘". Gmtime (). "', ' $goods _type ', ' $rank _integral ', ' $suppliers _id ')";Modified into"' $_post[goods_desc] ', '". Gmtime (). "‘, ‘". Gmtime (). "', ' $goods _type ', ' $rank _integral ', ' $_post[seo_title] ', ' $suppliers _id ')";847 rows found"Is_on_sale, Is_alone_sale, is_shipping, Goods_desc, Add_time, Last_update, Goods_type, Extension_code, RANK_ Integral) ".Modified into"Is_on_sale, Is_alone_sale, is_shipping, Goods_desc, Add_time, Last_update, Goods_type, Extension_code, RANK_ Integral,seo_title) ".853 rows"' $_post[goods_desc] ', '". Gmtime (). "‘, ‘". Gmtime (). "', ' $goods _type ', ' $code ', ' $rank _integral ')";Modified into"' $_post[goods_desc] ', '". Gmtime (). "‘, ‘". Gmtime (). "', ' $goods _type ', ' $code ', ' $rank _integral ', ' $_post[seo_title] ')";Search"rank_integral = ' $rank _integral ',".Add the code below"seo_title= ' $_post[seo_title] ',".4: Modify root directory goods.php No. 242 line Search//page title put code$smarty->assign (' page_title ', $position [' title ']); Page TitleReplaced by$smarty->assign (' Page_title ', trim ($goods [' seo_title '])? $goods [' Seo_title ']: $position [' title ']); Page TitleClear cache big Attack caused! Reprint: http://www.68ecshop.com/article-694.html

Ecshop Full site custom title title

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.