Phpcms single page SEO title resolution method

Source: Internet
Author: User

Article Source: www.bayinmao.com

Phpcms v9 single page call seo meta title and seo meta Keywords
because the single page is the default call SEO meta description, so now get a cut with SEO meta title and seo meta Keywords.Everyone should be written in the header file {if isset ($SEO [' title ']) &&!empty ($SEO [' title '])} {$SEO [' title ']}{/if}{$SEO [' Site_ Title '} This one.
This $seo variable is in the/phpcms/modules/content/index.php. so to find this $seo variable. V9 's code is very user-friendly. There are comments indicating the code that is a single page. I found the code block directly on the single page. Find here the $seo variable as follows:$SEO = SEO ($siteid, 0, $title, $setting [' meta_description '], $keywords);SEO This function is located in the file/phpcms/libs/functions/global.func.phpThe declaration of this function is:function seo ($siteid, $catid = ', $title = ', $description = ', $keyword = ')research on its definition, found that the second parameter is called column SEO meta title and seo meta keywords use, if it is 0 is not called. Modify the method. write the assignment of the above $seo$SEO = SEO ($siteid, $catid, $title, $setting [' meta_description '], $keywords);check on the Internet, but also to modify the/phpcms/modules/content/class/html.class.php inside the single page $seo variable (this should be generated static use.) )。 find comments indicating that those are single-page code as modified as:$SEO = SEO ($siteid, $catid, $title, $setting [' meta_description '], $keywords);
about the title there is a repetition, you can modify the SEO META title so look good point. There is a more bar behind the title. I will seo this function is located in the file/phpcms/libs/functions/global.func.php inside the$seo [' title '] = (isset ($title) &&! empty ($title)? $title: "). (Isset ($cat [' Setting '] [' meta_title ']) && empty ($cat [' Setting '] [' meta_title '])? $cat [' Setting '] [' Met A_title ']. '-': (Isset ($cat [' catname ']) && empty ($cat [' catname '])? $cat [' CatName ']. '-': ');modified to:$seo [' title '] = (isset ($title) &&! empty ($title)? $title. ‘_‘ : ‘‘) . (Isset ($cat [' Setting '] [' meta_title ']) && empty ($cat [' Setting '] [' meta_title '])? $cat [' Setting '] [' Met A_title ': (Isset ($cat [' catname ']) && empty ($cat [' catname '])? $cat [' CatName ']: ');

Phpcms single page SEO title resolution method

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.