To create a unique article detail page, we can start with several core functions of the Anqi CMS.
1. Flexible content model: the foundation for personalized display.
In the backend of AnQi CMS, we can enter the "Content Model" management interface, create new models according to actual needs, or modify existing models.Each model can add an arbitrary number of custom fields, with a rich variety of field types, including single-line text, numbers, multi-line text (supporting Markdown), single choice, multiple choice, dropdown selection, and more.By these custom fields, we can collect various unique information needed for publishing articles, laying a solid foundation for personalized display on the frontend.These structured data will become the core elements of the differentiated display of our article detail page.
English version: Fine-grained template tags: freely control content output
The template system of Anqi CMS is based on the Django template engine, providing a large number of practical and flexible tags, making it very simple to call and display content on the front end. In the article detail page,archiveDetail标签是获取文章数据的主力。它不仅能轻松获取文章标题(English),Title)、正文(English)Content), thumbnails (Thumb)et basic information, more importantly, it can directly call our custom content model fields. For example, if we add a field namedauthorThe custom field records the author, so in the template, we can directly display the author information through{% archiveDetail with name="author" %}to show the author information.
For displaying images in the article,archiveDetailTags provideImages(multiple images group),Logo(cover first image),Thumb(Cover thumbnail) and other options, we can selectively display according to the design requirements. What's more noteworthy is, the main content of theContentfield also supportslazyparameters to implement image lazy loading, as well asrenderParameters to control whether Markdown content is converted to HTML, which provides flexible control over the loading performance and presentation of the content.
In addition to the information in the article itself, we can also use other tags to enrich the personalized display of the detail page:
archiveParamsTags can cyclically display all custom fields of articles, or selectively display specific fields as required, which is very useful for displaying complex parameter lists on product detail pages.archiveListTag combinationtype="related"Parameters can intelligently display content related to the current article, throughlike="keywords"orlike="relation"Even more, you can accurately recommend by keywords or manual settings on the back end, greatly improving user stay time on the site.prevArchiveandnextArchiveThe label provides a convenient navigation to the previous/next article, optimizing the reading experience.tagListLabels can display all tags associated with the article, allowing users to discover more content on the same theme according to their interests.categoryDetailThe label can obtain the detailed information of the article's category, such as category introduction, Banner image, etc., to add more background information to the article detail page.- while
tdkThe tag allows us to customize exclusive SEO titles, keywords, and descriptions for each article detail page, ensuring **performance** in search engines.
Moreover, the template system of AnQi CMS is built-in with various filters, such assafeused to output HTML content without escaping,truncatecharsused to truncate overly long text,urlizeUsed for automatic recognition and conversion of URLs into clickable links, as well asdateUsed for formatting time display. These filters provide powerful auxiliary functions for processing and beautifying content output.
English
In addition to the flexible content call, the Anqi CMS also provides a high degree of freedom in the structure of template files, allowing us to design a completely unique layout for the article detail page. The system provides defaults for{模型table}/detail.htmlAs a general article detail page template, but further, we can go one step further, we canspecific articlesorSpecific categorydesignate an independent template file.
For example, by specifying a custom HTML file (such asdownload.html) as the document template in the "Other Parameters" section when editing an article in the background,download.htmlThe layout.For a special thematic page or an important product landing page, this ability means we can break free from the constraints of general templates and design a unique interface that fully meets its marketing or display needs.
At the same time, the mechanism of template inheritance (extendsandblocktags) also greatly improves the reusability of templates. We can define a generalbase.htmlAs the skeleton of the website, it includes common elements such as header, footer, sidebar, etc., and then makes all article detail page templates inherit this skeleton. In the inherited template, we can overwrite specificblockArea, to achieve personalized display of article titles, main content, related recommendations, etc., while maintaining the overall visual consistency of the website, also endows each detail page with unique charm.
CombineifLogical judgment label, we can also dynamically adjust the layout and content according to the specific attributes of the article. For example, if an article is marked as "recommended", we can use the template to{% if archive.Flag == 'c' %}Add a special recommendation badge; or display different promotional information or purchase buttons based on the "price" in the custom field.
English, operation strategy integration: enhance the value of personalized display
The personalized display is not an isolated technical implementation; it also requires a close integration with content operation strategy to maximize its value. In the AnQi CMS backend, we can use:
- Recommended Attribute (Flag): Mark important articles as 'Top News', 'Slide', 'Recommended', etc., for more prominent display on the detail page.
- Tag tagsTo tag the article accurately, not only is it convenient for users to search, but it can also guide users to delve deeper through tag clouds or related tag recommendations on the detail page.
- Timing release function:Preset article publishing time, ensure that the content goes live at the right time, improving the timeliness and attractiveness of the content.
- Advanced SEO toolsAlthough Sitemap, keyword library, anchor text, etc. do not directly change the content display of detail pages, they greatly enhance the visibility and search engine rankings, giving personalized display an opportunity to reach more potential users.
Through the combination of a series of functions and strategies, our CMS can help us build article detail pages that are both beautiful and practical.From the underlying data structure to the front-end visual presentation, every link is filled with personalized possibilities, thus truly enhancing the user experience and ultimately helping the website achieve its operational goals.
Common Questions (FAQ)
1. Ask: If I create a custom template for a specific article, but the template file does not exist or the path is incorrect, how will the article detail page be displayed?
答:English CMS will usually adopt a fallback mechanism in this case to prevent page crashes. If the specified custom template file does not exist or the path is incorrect, the system will try to use the default detail page template of the content model to which the article belongs (for examplearticle/detail.htmlorproduct/detail.htmlTo render content.If the default template does not exist, the page may display an error message.Therefore, it is recommended to check the front-end display effect in time after specifying a custom template in the background.
2. Ask: How can we automatically recommend related articles or products based on the content of the article detail page to improve user retention rate?
Answer: You can usearchiveListTemplate tags, and settype="related"参数来实现相关内容的自动推荐。This tag will default to intelligently searching and displaying similar or related articles based on the current article's category, tags, or keywords.In addition, while editing articles in the background, you can also manually associate some related documents to provide more accurate recommendations.This helps users find more interesting information after reading the current content, extending their stay on the website.
3. 问:Can I load different content modules for different areas of the article detail page (such as the sidebar, footer), for example, the latest comments, the most popular article list, or specific ad slots?
答:完全可以。English CMS的模板系统支持通过includeThe label modularizes different areas of the page, such as encapsulating the sidebar, the bottom area of the article, etc. into independent template files.Then, within these modules, you can use different tags to dynamically load content according to your needs.commentList标签获取文章评论列表,用archiveList标签并结合order="views desc"(By descending order of views)to display the most popular articles, or through the backend custom settings (such asdiyTags) to insert specific advertisements or promotional content. This modular design provides a high degree of flexibility in page layout and content display.