As a website operator familiar with the AnQi CMS, I am well aware of the importance of a well-structured and easy-to-maintain template for the long-term healthy operation of the website.How to efficiently organize and store common headers, footers, and other reusable code snippets during template creation is the key to improving development efficiency and ensuring website consistency.

In AnQi CMS, the template system uses syntax similar to Django template engine, which provides us with powerful tools to achieve code reuse and modular management. By utilizingextendsandincludeThese two core tags, we can build a clear, layered template structure.

Taking advantage of the template features of AnQi CMS

extendsThe label allows us to define a basic template skeleton, usually referred to as a 'master' or 'layout template'. This master file will contain the overall HTML structure of the website, such as<html>/<head>/<body>Tags, as well as the general layout framework of the website. In the master page, we useblockLabels are used to define specific areas that can be overridden or filled by child templates, such as the title area, main content area, or sidebar area. All child templates inheriting this master file only need to focus on filling theseblockThe specific content of the area, without the need to rewrite the entire page's common structure. This inheritance mechanism greatly reduces duplicate code and ensures the consistency of the overall layout of the website.

includeThe tag is used to introduce smaller, more specific code snippets.These code snippets can be independent components of a page, such as the top navigation menu, bottom copyright information, sidebar widgets, breadcrumb navigation, contact module, and so on.includeWe can reference tags to break down complex pages into smaller, easier-to-manage parts, improving the modularity and readability of the code