How to set and display the common areas of the website such as header, footer, and sidebar in AnQiCMS?

Calendar 👁️ 83

In website operation, header, footer, and sidebar public areas play a crucial role.They not only carry the brand image and navigation function, but are also the key to improving user experience and content distribution efficiency.For friends using AnQiCMS, understanding how to efficiently set up and display these areas will greatly enhance the professionalism and operational convenience of the website.

AnQiCMS as an enterprise-level content management system developed based on the Go language, has fully considered the flexibility and scalability of the template from the beginning of its design.This means that whether you are creating a simple corporate website or a content-rich self-media platform, you can easily master the layout and content of these public areas.

Build the skeleton of a website: template basics and common code

AnQiCMS follows clear conventions in template design. When you delve into the template files of the website, you will find a file named/templateThe root directory, which contains all the templates your website is using. For those common parts that appear on every page, such as headers and footers, they are usually placed in a folder namedbash.htmlThe file in. This file is like the "skeleton" of your website, providing a unified structure for all pages.

And content like sidebars, breadcrumb navigation, which may appear in different forms on different pages, or as independent modules referenced by multiple pages, is classified aspartial/Under the directory, existing in the form of code snippets. This modular design concept makes the management of the website's common area organized, and modifying one place can take effect globally, greatly improving the maintenance efficiency.

Gracefully present the page header: brand identity and core navigation

The header is the first part that appears to the user when entering the website, carrying the website's Logo, main navigation, and some important contact information.In AnQiCMS, setting these elements is an intuitive and flexible process.

The website's logo is a direct manifestation of the brand image, you can easily upload and manage your logo picture in the background's global feature settings. Once uploaded, through the template in the{% system with name="SiteLogo" %}The tag can be called and displayed in the header. At the same time, the name of the website can also be accessed through{% system with name="SiteName" %}Label acquisition, which helps unify the brand image and ensure easy updates across the entire website.

The core navigation is the key to guiding users to explore the website. AnQiCMS provides a powerful 'website navigation settings' feature, allowing you to create multiple navigation categories, such as 'top main navigation', 'footer navigation', and even 'sidebar navigation'.After setting up the navigation links and levels in the background (AnQiCMS supports two-level navigation), you can then use them in the template{% navList navs with typeId="导航类别ID" %}Labels to dynamically acquire and render these navigation items. For example, you can specifytypeId=1Call your main navigation, thenforTraverse in a loopnavsVariable, display the title and link of each navigation item. If there is a sub-navigation under the navigation item,item.NavListproperties will help you expand further.

Sometimes, you may also want to display some contact information or important promotional banners in the page header. By using the information configured in the "Contact Information Settings", you can display through{% contact with name="Cellphone" %}or{% contact with name="Email" %}Tags can dynamically display phone numbers, email addresses, and other information in the page header. The carousel or important promotional images in the page header can be displayed through{% bannerList banners %}Tags, combined with the background "Homepage Banner List" settings, can be flexibly displayed.

Structured display of the footer: copyright information and auxiliary links

The website footer, although located at the bottom, carries important content such as legal statements, copyright information, auxiliary navigation, and friend links, which play an indispensable role in the trustworthiness and SEO of the website.

AnQiCMS also provides a convenient way to manage this content. The website's filing number and copyright information can be filled in at the "Global Function Settings". Then, through{% system with name="SiteIcp" %}and{% system with name="SiteCopyright" %}Label, this information can be accurately displayed in your footer.

For the convenience of users, the footer usually also includes some auxiliary navigation, such as "About Us", "Privacy Policy", and so on. At this point, you can create an independent navigation category in the "Website Navigation Settings", for example, named "Footer Navigation", and allocate a uniquetypeIdThen, use it again in the footer template{% navList navs with typeId="你的页脚导航ID" %}Tags can easily render these auxiliary links.

Friendship links are an indispensable part of many websites, helping to establish external links and enhance the weight of the website.AnQiCMS provides a special "Friend Link Management" feature, where you can add and edit friend links in the background.In the footer template, use{% linkList friendLinks %}Label, you can dynamically display these friendship links and can judge whether to add them according to your needsnofollowProperty.

Rich and diverse sidebar: content discovery and user interaction

The sidebar is an important area for improving the discoverability and user engagement of website content. In AnQiCMS, you can use flexible template fragments (partial/) and various content tags to build a rich and diverse sidebar.

To create a sidebar, you would typically first create one inpartial/the directory, for examplesidebar.html. Then, in the page template where the sidebar needs to be displayed, use{% include "partial/sidebar.html" %}tag to include it.

Common elements of the sidebar include:

  • Category List: to guide users to browse different content categories. Use{% categoryList categories with moduleId="文章模型ID" parentId="0" %}Label, you can get all top-level categories under the specified content model, and you can further obtain their child categories in a loop to build a multi-level category navigation.
  • Latest or popular articles:Attract users to click and read the active content on the website. Through{% archiveList archives with type="list" limit="10" order="id desc" %}(Latest articles) ororder="views desc"(Popular articles), you can easily obtain and display a specified number of document lists.
  • Tag Cloud: Display the popular tags of the website, making it convenient for users to explore content through their interests.{% tagList tags with limit="20" %}Tags can help you list the active tags on the website.
  • Single-page content or ad spaceYou may need to display some "About Us" introductions in the sidebar, or place advertisements. Through{% pageList pages %}Tags to get specific single-page content, or directly insidebar.htmlWrite static HTML code, which can meet these needs.
  • Breadcrumbs navigation: Although it often appears below the page header, it is also a public navigation component. Through{% breadcrumb crumbs %}Tags, which can help users understand the position of the current page in the website structure.

Combine with the display of these lists,{% for item in list %}loop and{% if condition %}Judge, you can finely control the way content is displayed, such as adding a highlight style to the current category, or displaying only articles with thumbnails.

Flexible customization: Make the public area smarter

The strength of AnQiCMS lies not only in its ability to display static content, but also in its high degree of customization, which allows public areas to become smarter according to the context.

For example, if you want a unique Banner image for a specific category or single page, you can edit the category ("Content Management" > "Document Category") or single page ("Page Resources" > "Page Management") in the background when

Related articles

How to highlight the link of the current visited page in the navigation menu?

When a user visits your website, a clear and intuitive navigation menu can significantly enhance their browsing experience.One important optimization is to make the navigation menu intelligently highlight the current page link being visited, so that visitors can clearly know where they are on the website.AnQi CMS provides a simple and powerful way to implement this feature, without complex development, just need to configure cleverly in the template.### Understanding the navigation mechanism of Anqi CMS Anqi CMS is built with a flexible template tag system, the core of which is the "navigation list tag"

2025-11-08

How to create and display multi-level navigation menus in AnQiCMS?

In website operation, a clear and effective navigation menu is the core of user experience, which can help visitors quickly find the information they need.AnQiCMS (AnQiCMS) knows this well and provides flexible and powerful features for you to easily create and manage multi-level navigation menus, whether it is a simple two-level dropdown menu or a complex menu combined with dynamic content display, it can meet your needs. Next, we will learn together how to create and display multi-level navigation menus in AnQiCMS.### One, Back-end Management

2025-11-08

How to display 'Previous article' and 'Next article' links on the article detail page?

In website content operation, optimizing the reading experience of users has always been one of our core goals.When immersed in an excellent article, it is natural to want to smoothly switch to related or the next article without having to return to the list page to find it.This seamless navigation can not only effectively improve the user's stay time on the website, reduce the bounce rate, but also help search engines better understand the structure of the website content, thereby having a positive impact on SEO.Aqy CMS provides a very intuitive and easy-to-use solution for this

2025-11-08

How to sort the list display according to the creation time or view count of the articles?

In website content operation, the presentation sequence of content is crucial for user experience and information delivery efficiency.Whether it is a news portal, technology blog, or product showcase website, reasonably adjusting the sorting method of the content list according to different operational goals can significantly enhance the vitality and attractiveness of the website.AnQiCMS (AnQiCMS) is well-versed in this, providing intuitive and powerful features that allow us to easily sort the content list by the creation time or number of views.###

2025-11-08

How to correctly display the breadcrumb navigation path on a web page?

Elegantly configure breadcrumb navigation in AnQiCMS: Improve user experience and SEO performance When you visit a website, breadcrumb navigation is like a considerate guide, it can clearly tell you where the current page is in the website structure.From the home page all the way to the page you are browsing, it not only helps users quickly understand the website hierarchy, but also makes it convenient for them to backtrack to the upper page.For the website's search engine optimization (SEO), a reasonable breadcrumb navigation can also help search engines better understand the website structure, thereby possibly bringing better crawling and ranking effects

2025-11-08

How to set and display the SEO title, keywords, and description (TDK) of a website in AnQiCMS?

When building a website, Search Engine Optimization (SEO) is the key to ensuring that content is discovered by search engines and attracts potential visitors.And the SEO title (Title), keywords (Keywords), and description (Description), abbreviated as TDK, are one of the most basic and most important elements in website optimization.They directly affect the display and click-through rate of websites in search results.

2025-11-08

How to configure and display a canonical URL to optimize search engine crawling?

It is crucial to ensure that search engines efficiently and accurately crawl and understand our content in website operation.Among them, the canonical URL is an indispensable SEO strategy.It can help us solve the problem of duplicate content, concentrate the page weight, and thus optimize the website's performance in search engines.AnQiCMS as a SEO-friendly and powerful content management system naturally also provides comprehensive specification link configuration options, allowing users to easily manage this important function.What is the canonical link

2025-11-08

How to display the website logo, filing number, and copyright information on the frontend page?

The website's logo, filing number, and copyright information are the three indispensable elements that constitute a professional and trustworthy online image.They not only help with brand recognition and promotion, but are also an important embodiment of compliance with laws and regulations and enhancing the credibility of the website.As a system specially designed for small and medium-sized enterprises and content operation teams, AnQiCMS (AnQiCMS) fully understands the importance of these details and provides an extremely convenient way to manage and display them.

2025-11-08