How to view the URL link address of a specific category?

Calendar 👁️ 66

In AnQiCMS (AnQiCMS), managing and obtaining the URL link address of categories is a basic and important task in website operation.It is crucial to clearly know how to view and use these links for content organization, SEO, or user navigation.As a content management system dedicated to providing efficient and customizable solutions, AnQiCMS offers flexible and intuitive options in this regard.

Understanding the basic structure of Anqi CMS category URL

In AnQiCMS, the category URL is not constant and is influenced by two main factors:The website's pseudo-static rulesandThe category's custom URL settings. The static rules of the website define the overall structure pattern of the URL (for example, whether it includes category ID, category name, etc.), and the "custom URL" of each category is the specific part of the category displayed in the URL.The combination forms the complete link that the user ultimately sees in the browser.

View and edit directly through the back-end management interface

The most direct way to view the URL link address of a specific category is to enter the AnQiCMS back-end management interface.

  1. First, you need to log in to the AnQiCMS backend and then navigate to“Content Management”module.
  2. Under "Content Management", you will see“Document Category”options, click to enter.
  3. On this page, the system will list all the categories on your website. You can click on any target category'sEditbutton (usually an pencil icon), to enter the editing page of that category.
  4. In the category editing page, you will find a named"Custom URL"The field. This field is usually automatically generated based on the category name you enter, as a unique identifier for the category in the URL.For example, if your category name is "Company News", the system may automatically generategongsi-xinwenOf course, you can also manually modify this field to better suit your brand or SEO strategy, but please ensure its uniqueness throughout the site.

This "custom URL" is the key part that constitutes the actual access link of the category.Although this shows a relative path segment, when combined with the static rule configuration of your website, it will form a complete and accessible category URL.For example, if your pseudo-static rule is set to 'Category Naming Mode', the value in the 'Custom URL' field will directly appear in the final URL, such ashttps://yourdomain.com/category/gongsi-xinwen.html.

Dynamically obtain the category URL in the front-end template

In addition to viewing in the background, it is also a common requirement to dynamically obtain and display the URL links of categories in the front-end template of a website, such as building navigation menus, breadcrumb navigation, or referencing categories in content lists.AnQiCMS provides convenient and easy-to-use template tags.

To obtain the URL link of a single specific category, you can usecategoryDetailTags:

{# 获取ID为1的分类的链接 #}
{% categoryDetail categoryLink with name="Link" id="1" %}
<a href="{{categoryLink}}">访问分类</a>

In this code block:

  • {% categoryDetail categoryLink with name="Link" id="1" %}This line of code tells AnQiCMS to get the details of the category with ID 1 and assign its 'Link' attribute (i.e., the URL address) to a variable namedcategoryLink.
  • <a href="{{categoryLink}}">访问分类</a>: After that, you can use it in HTML.{{categoryLink}}This variable is used to output the complete URL of the category, and build a clickable link.

If you need to display multiple categories and their links in the navigation bar, sidebar, or other areas of the website,categoryListtags are more efficient:

{# 获取模型ID为1(如文章模型)的所有顶级分类列表 #}
{% categoryList categories with moduleId="1" parentId="0" %}
    <ul>
    {% for item in categories %}
        <li><a href="{{ item.Link }}">{{item.Title}}</a></li>
    {% endfor %}
    </ul>
{% endcategoryList %}

here,categoryListIt will loop through the specified category and will include detailed information for each category (includingLinkandTitle) and assign it toitemVariable, you can then pass through{{ item.Link }}to get the URL address of each category and use{{ item.Title }}to display the category name.

These template tags can automatically render the current effective and correct link address regardless of how your website backend adjusts the static rules or how the "custom URL" of the category changes, greatly simplifying the maintenance of front-end content.

The impact of static rules on URLs

The reason why AnQi CMS can generate SEO-friendly URLs is largely due to its powerful static rule management function. You can find it in the background of“Function Management”the module.“Static Rules”Option. Here, you can choose from several built-in pseudo-static rules, such as "numeric pattern", "model naming pattern", or "category naming pattern", and you can also customize the rules.

For example, if you select "category naming pattern", the URL structure of the category will usually include the value of its "custom URL" field, forming such as/category/your-category-name.htmlThe format. When you modify the "custom URL" of a category in the background or switch the overall pseudo-static rules, AnQiCMS will intelligently update the corresponding link address to ensure the continuity of the website and help search engines better crawl your content.This means, whether viewed directly through the backend or dynamically obtained through template tags, the obtainedLinkThe attribute will provide the complete and standardized URL for the end user to access according to the currently effective pseudo-static rule.

Summary

In AnQiCMS, viewing and using the URL link address of a specific category is flexible and diverse. You canThe "Content Management" under the "Document Category" interface allows you to directly view and edit the "Custom URL" of the categoryThis is the core part of constructing a URL. At the same time, you can cleverly usecategoryDetailandcategoryListetctemplate tags to dynamically obtain the complete URL link of the categoryThese links will automatically adapt to the website's pseudo-static rules. Mastering these methods will make content operation and website management on Anqi CMS more intuitive.


Frequently Asked Questions (FAQ)

  1. Ask: Why is the 'Custom URL' I see in the 'Document Classification' backend not exactly the same as the link address I access on the front end?Answer: This is because the "Custom URL" field in the background displays only a part of the URL, which needs to be combined with the "pseudo-static rules" configured on your website to form the complete link that users actually access. For example, the "Custom URL" might begongsi-xinwenIf your pseudo-static rule is set to 'Category Naming Mode', then the actual link on the front end may behttps://yourdomain.com/category/gongsi-xinwen.html. The system ensures that the backend editing is concise while providing the flexibility of the frontend URL and SEO-friendliness.

  2. Ask: What impact will it have on the website's SEO if I modify the 'custom URL' or static rules of the category?Answer: Modifying the URL structure of the category may affect SEO because search engines have indexed the old URL. To avoid losing search engine authority and user access dead links due to link changes, it is strongly recommended to go to the AnQiCMS backend immediately after making such changes.“Function Management” -> “301 Redirect Management”Set the appropriate 301 redirect. Redirect the old URL permanently to the new URL, so that you can inform search engines that your page has been migrated, and pass the weight of the old page to the new page, thereby minimizing the negative impact as much as possible.

  3. Question: In the template, can I get the URL of other specified categories in addition to the category URL of the current page?Of course, you can. UsecategoryDetailwhen using tags, you can go throughidortokenparameters to specify which category of URL to retrieve. For example,{% categoryDetail categoryAboutLink with name="Link" token="about-us" %}you can get the 'Custom URL' asabout-uscategory link, even if the current page is not the category page. Similarly,{% categoryDetail categoryNewsLink with name="Link" id="5" %}You can obtain the link address of the category with ID 5. This method provides great flexibility, making it convenient to refer to specific categories on any page.

Related articles

What is the default URL structure of the article detail page in AnQiCMS?

As an experienced website operations expert, I am well aware of the importance of the URL structure of a website for SEO optimization and user experience.In AnQiCMS, a content management system committed to providing efficient and customizable solutions, understanding the URL structure of its article detail page is the foundation for content operation and SEO layout. Let's delve into how the default URL structure of the article detail page in AnQiCMS is designed.--- ## Reveal the default URL structure of AnQiCMS article detail page: Flexible and

2025-11-06

Why is my custom URL alias not working, what path configurations should I check?

As a senior website operations expert, I fully understand the confusion and anxiety you feel when the custom URL alias you carefully set up does not work as expected.A clean, meaningful URL structure is crucial for a website's SEO performance and user experience.AnQiCMS (AnQiCMS) was designed with flexibility in URLs and SEO friendliness in mind, but to make these features work, we do indeed need to ensure that the configuration of several key paths is correct.Today, let's delve into the discussion when your custom URL alias is "**"

2025-11-06

How to get the full URL address of the current page being accessed in the template?

## Deep Analysis: How to cleverly get the complete URL address of the current page in Anqi CMS template As an experienced website operation expert, I am well aware that it is a common and important need to accurately obtain the complete URL address of the current page in daily work.In order to set the `canonical` tag, share on social media, pass parameters, or perform data statistics, the accurate URL of a page is core information.

2025-11-06

Can I view the path of the template file on the server directly through the AnQiCMS background online template editing feature?

As an experienced website operations expert, I am well aware of the importance of template management for website personalization and operational efficiency.AnQiCMS (AnQiCMS) boasts its high efficiency and flexibility, which is favored in the content management field. Its template editing function on the back-end provides great convenience for content operators.TodayUnlocking AnQiCMS Template Path

2025-11-06

When customizing the content model, which page paths will be affected by the `URL Alias` field?

## Unveiling AnQi CMS Custom Content Model: How Does the "URL Alias" Affect Your Website Page Path??As an experienced website operations expert, I am well aware of the importance of the page path (URL) for user experience and search engine optimization (SEO).A clear, meaningful, and easy-to-understand URL that not only helps users navigate the website better but also effectively improves the crawling efficiency and keyword ranking of search engines.

2025-11-06

When introducing external CDN resources in a template, which template file is recommended to add the relevant code to?

As an experienced website operations expert, I fully understand the importance of managing external resources in a CMS system.Reasonably introducing external CDN resources can not only significantly improve the loading speed and user experience of the website, but also effectively reduce the bandwidth pressure on the server.In an AnQiCMS (AnQi CMS) such an efficient content management system, following its template design specifications, choosing the correct introduction position will make your work twice as efficient.### Understanding AnQiCMS's template structure and philosophy Firstly, we need to understand AnQiCMS

2025-11-06

How to find the domain name setting option in the AnQiCMS admin interface?

As an experienced website operations expert, I am well aware of the importance of a stable, secure, and easy-to-manage backend interface for website operations.AnQiCMS has fully considered this point in its functional design, especially in the settings of domain names in the background management, providing flexible and practical options, aiming to enhance the security and professionalism of the website. Today, let's talk about how to find and properly configure the domain settings option in the AnQiCMS admin interface to make your website management more convenient.

2025-11-06

What is the path of the initialization installation page displayed when AnQiCMS is installed and accessed for the first time?

As an experienced website operations expert, I know how crucial the initial installation experience of a content management system is for users.AnQiCMS (AnQi CMS) has won the favor of many users with its high performance brought by the Go language development and many enterprise-level features.However, after the system deployment is completed and the browser is opened for the first time to access, many new users may wonder where the 'initial installation page' is located?This question feels a bit confused.

2025-11-06