As a website operator familiar with 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 a website.How to efficiently organize and store common page headers, footers, and other reusable code snippets during template creation is crucial for improving development efficiency and ensuring website consistency.

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

Utilize the template features of AnQi CMS.

extendsTags allow us to define a basic template structure, usually referred to as a "master" or "layout template". This master file will include the overall HTML structure of the website, such as<html>/<head>/<body>Tags, as well as the common layout framework of the website. In the master template, we useblockA tag defines a specific area that can be rewritten or filled by child templates, such as the title area, main content area, or sidebar area. All child templates inheriting this master template need to focus on filling theseblockContent that is unique to the region, without the need to rewrite the common structure of the entire page. This inheritance mechanism greatly reduces redundant code and ensures the consistency of the overall website layout.

includeTags are used to introduce smaller, more specific code snippets. These snippets can be independent components of a page, such as top navigation menus, footer copyright information, sidebar widgets, breadcrumb navigation, contact modules, etc.By isolating these mini components into files and usingincludeBy referencing tags, we can break down complex pages into smaller, more manageable parts, improving the modularity and readability of the code