An QiCMS: Create a dedicated display template for every article of yours
In our daily website operations, the diversity of content presentation is the key to improving user experience, enhancing brand image, and optimizing SEO effects.Different types of articles often require different layouts and features, such as a deep technical analysis article that may need a more focused reading interface, while a product introduction page requires richer image display and purchase buttons.Can AnQiCMS (AnQiCMS) meet the need for setting independent display templates for different articles?
I can clearly tell you that Anqi CMS not only can do it, but also provides very flexible and convenient operation methods, allowing you to meet your actual content needs, giving unique visual and functional experience to articles, categories, and even independent pages.
Flexible and versatile, the core capability of custom template creation
The reason why Anqi CMS can achieve this is due to its highly customizable design philosophy and deep support for template engines.The system allows you to upload and manage multiple sets of templates, and you can specify different HTML files to be used as display templates for specific content elements - whether it is a single article, a list of articles in a category, or an independent static page.This means that you are no longer limited by the overall theme of the website, and can create a dedicated stage for each unique story or product.
How to set up independent display templates for different content?
Operating in Anqi CMS is far more intuitive than you might imagine.
a dedicated template for a single article
When you edit a specific article in the background, you will find a collapsible area named "Other Parameters." Expand this area, and you will see a field named "Document Template."
Suppose you have an article specifically designed to provide software downloads. You may want its layout to be different from that of a regular news article, such as including a prominent download button and more technical parameters. At this time, you can edit this specific article in the background by entering the name of the template file you have designed in advance in the "Document Template" field under "Other Parameters", for example,download.html. Just thisdownload.htmlThe file exists in the template package you are currently using, and Anqi CMS will automatically call this exclusive template to render the content when the user accesses this downloaded article.
To customize templates in bulk for the entire category
The template customization capability of AnQi CMS is not limited to single articles, but can also be applied to the entire category.This is very useful when you need to unify the display style of a certain type of content (such as "company news","industry dynamics" or "product case").
When editing a category of an article, you can also find two fields related to the template in the "Other Parameters" area: "Category Template" and "Document Template".
- "Category Template":If you want the article list page of this category to have a unique appearance, for example, for the "Company News" category list page and the "Product Display" category list page to be completely different, you can specify a template file in the "Category Template" field when editing the category, such as
article/news_list.html. All users visiting this category list page will see the layout rendered by thisnews_list.htmltemplate. - “Document Template”:Further, if you want all articles under a certain categoryto be displayedAll default to use the same specific template (unless the article is set to a more specific template separately), Anqi CMS also provides a "Document Template" field. For example, you can set a default "Document Template" for the "Product Details" category as
product/detail.htmlThen, all product articles under this category will useproduct/detail.htmlto display, ensuring a unified style for the product page - Template inheritance:When setting up the category template, there is also an option for 'Apply to subcategories'.Check this option, the template style set for the current category will automatically inherit to all its subcategories, saving the trouble of repeated settings.
individualized template for a standalone page
For pages like "About Us" or "Contact Information" that are independent single pages, you can also customize the display template specifically for them. When editing a single page in page management, find the "Single Page Template" field and enter for examplepage/about_us.htmlSuch template path. In this way, your "About Us" page can have a unique display style, distinguishing it from the article and product pages.
A smarter template application: naming conventions
In addition to explicitly selecting template files in the background, Anqi CMS also supports a more intelligent and automated way of applying templates - by following specific naming conventions.This means that if you name your template files according to the system's predefined rules, the system can automatically recognize and apply them without manual specification in the background.
For example:
- Document details:You can create a name called
{模型table}/{文档ID}.htmlOf the template, for examplearticle/10.htmlIt will be automatically applied to the article with ID 10. - Category list:Create
{模型table}/list-{分类ID}.htmlFor examplearticle/list-5.htmlwill be automatically applied to the article category list with ID 5. - Single page:Create
page/{单页面ID}.htmlorpage/{自定义URL别名}.htmlFor examplepage/about.htmlwill be automatically applied to the single page with alias "about".
This naming convention provides great convenience for websites that have a large amount of content or specific content management needs, making template maintenance and expansion more efficient.
Why is this flexibility important?
This template customization feature brings many benefits:
- Improve user experience:Provide the most suitable reading or browsing interface based on the type of content, making it easier for visitors to find the information they need and stay longer.
- Strengthen brand consistency and differentiation:The core content page can maintain the brand style, while special event or topic pages can break away from the framework to create a unique visual effect.
- Optimize SEO:Customized templates can better integrate SEO elements such as structured data, specific content layout, which helps search engines better understand and index your content.
- To implement specific functions:For example, integrating a specific download counter for the download page, adding an evaluation module for the product page, etc., all of these can be easily achieved through exclusive templates.
This template mechanism of AnQi CMS undoubtedly provides us with powerful content display control.Whether it is the personalized presentation of every article or the mass style definition of the entire content category, it can handle it with ease, making your website content come alive.
Frequently Asked Questions (FAQ)
1. I set a default document template under a certain category, but I also specified another document template for a specific article in that category. Which template will take effect?
The template priority of AnQi CMS follows the principle of 'the more specific, the better'.If you have set a document template separately for a specific article, that article will use the template you specified separately first.Only when the article does not have a separate template set, will it inherit the default document template set in its category.This design ensures fine-grained control of content.
2. Why is the custom template filename I specified for an article or category showing an error when accessed on the frontend?
This situation usually occurs, the most likely reason is that the template file you specified does not exist in the template package you are currently using, or the path is incorrect. Anqi CMS will betemplateLook for the specified file in the current template folder under the directory.Please carefully check that the name of the template file is spelled correctly, including capitalization, and that it indeed exists in the correct subdirectory.If the system cannot find the specified template file, it cannot render the page, resulting in an error.
3. Does AnQi CMS support setting different templates for mobile and PC articles?
Yes, AnQi CMS fully supports multi-terminal adaptation. At the level of template design, you can create a folder namedmobileThe subdirectory, and place the mobile dedicated template files in it, the directory structure is consistent with the PC template.Then, you can select the "PC+Mobile" template mode in the "Global Function Settings" on the back end, and you can configure an independent mobile access address.This way, the system can automatically switch to display the corresponding PC or