Home >Backend Development >PHP Tutorial >How to make a template in phpcms
Among the many templates used by the editor, I feel that phpcms is more convenient to use. Compared with other cms such as dedecms and WordPress, the editor feels that the secondary development, template grammar rules, etc. phpcms is still good to use. Although the official website is basically not maintained and updated, this does not affect our use. Some large websites are also developed by phpcms, such as the official website of the 2019 Wuhan Military Games, and some website construction agencies that do SEO are also the first choice for website construction. It's phpcms. It shows that phpcms is still a good choice for quickly building a website.
So how do we make a phpcms template? For this, you first need to have a basic knowledge of html, div css, and then some common JavaScript syntax. Then based on them, the corresponding data is called according to the syntax rules of phpcms. The default website template directory is index.html in phpcms\templates\default\content. We can also create a new template directory. There is basically no need to modify the program.
{pc:content action="hits" catid="11" num="10" order="views DESC"}
The above action represents the model value with lists, and the hits represent respectively What is called is the data in the article list and click ranking list. catid is the column id, which can be obtained from the website backend.
The corresponding css and js files are placed in the css, images and js folders of statics in the root directory of the website. When citing, the syntax of the path is {CSS_IMG}/you css file name, the same is true for js and images. Follow the template syntax rules.
Then the most common ones are the processing of banner and the calling of home page slide. We can all use the idea of creating a new column to solve the problem, and then call the data of this column. There are many solutions, including creating a separate banner module for management, etc.
Some common data that is not frequently modified, such as company name, contact number, address, etc., can be solved through phpcms fragmentation.
phpcms fragment uses
to build websites for customers, and the principle of modifying these constants can be achieved even without touching the code. Although only a few points are briefly introduced here, 80% of corporate website construction problems can be solved.
Of course, this cms also has certain loopholes, and it is easy to be hacked and linked. This is a common problem with open source cms. We need to pay attention to website security. That’s it for the brief introduction. If there is anything else you don’t understand, please leave a message.
For more PHP related technical articles, please visit the PHP Tutorial column to learn!
The above is the detailed content of How to make a template in phpcms. For more information, please follow other related articles on the PHP Chinese website!