What detailed information will the nested `category` object return?

Calendar 👁️ 71

When we explore the mysteries of AnQi CMS, we often need to obtain detailed information about the documents.archiveDetailThe interface provides us with rich document data, and there is nested in it.categoryAn object, then, is a often overlooked yet extremely important repository of information.It is not just a simple classification ID, but a complete entity containing all the metadata of the classification, which provides great convenience for us to deeply understand the context of the document and to carry out refined content display.

This nested one.categoryAn object, like the ' household register ' of a document, records all the details of the document's classification. It first clearly tells us the unique identifier of this classification.idand its direct superior category of,parent_id.By these two fields, we can clearly outline the hierarchical structure of categories, for example, a document may belong to the category of "front-end development", and "front-end development" may belong to the higher-level category of "technical tutorials".title(i.e., the category name) andurl_token(Used to build the category page URL alias) is also core information, they are the foundation for displaying category names and link jumps on the front-end page.

In addition to this,categoryThe object also provides critical data for the website's search engine optimization (SEO).seo_title/keywordsanddescriptionThese fields directly correspond to the SEO title, keywords, and description of the category page. This means that when we are displaying document details, if we need to refer to the SEO information of the category it belongs to, we can directly fromcategoryObtained from the object without additional queries. This is very helpful for improving the overall SEO performance of the website, as well as generating more accurate summaries when sharing on social media.

In terms of content presentation,categorythe object also provides rich visual and text information without sparing any effort. If the category itself has specific introductory content, thencontentThe field will contain this text detail. In addition,images/logoandthumbThey represent the category banner image, main logo, and thumbnail.These image resources make the classification more visually identifiable, bringing a more intuitive experience to users in scenarios such as category navigation and related recommendation modules.

Finally, we can also obtain some important technical and management properties fromcategorythe object.module_idIt specifies the content model that the category belongs to (such as article model, product model, etc.),typeThe field distinguishes the nature of the category, whether it is a common category list (value 1) or an independent single page (value 3).sortThe field is used to control the display order of the categories, andcreated_time/updated_timeandstatusWaiting for timestamp and status information makes it convenient for us to manage, filter, and display content.

In short,archiveDetailNested in the interfacecategoryAn object is a comprehensive data package that tightly associates documents with their categories, providing a one-stop solution for obtaining classification information.This greatly simplifies the work of developers in building complex page logic and allows content operators to present content to users in a richer and more precise way, thereby enhancing the professionalism and user experience of the website.


Frequently Asked Questions (FAQ)

1. Why am IarchiveListIn the document data obtained from the interfacecategoryObjects are sometimes empty, but inarchiveDetailthey are complete?

archiveListThe interface is mainly used to get a list overview of documents, for performance considerations, it usually only returns the core information of the documents, such ascategory_idIt will not load all the detailed data of the category. Therefore,archiveListofcategoryObjects are usuallynullor contain very little information. Only when you callarchiveDetailWhen the complete information of a single document is obtained through the interface, only then will the security CMS encapsulate all the detailed information of the category to which the document belongs intocategoryReturn within the object to ensure the most comprehensive context is provided.

2.categoryWithin the objecttypeField, the difference between “1 Category, 3 Single Page” is what?

typeField used to identify the category attribute. WhentypeThe value is1When, it indicates that this is a common category, it usually contains a series of documents (such as an article list), used for aggregating and displaying related content. WhiletypeThe value is3It indicates that this is a "single-page", which means that the category itself is an independent page with its own content, it may not contain a list of sub-documents, but instead directly displayscontentDetailed content of the field, such as "About Us

3. If I only need the name of the category (title) and the link (throughurl_token generated), use it directly.archiveDetailWould the interface fetching cause data redundancy? Is there a lighter-weight way?

Yes, if your needs are very simple, just to display the category name and link, and it has already passedarchiveDetailThe interface obtained the document data, then extract directly from the nestedcategoryobjecttitleandurl_tokenIt is a very convenient and efficient approach without causing additional performance burden. But if you need detailed information of a category rather than as a subordinate category of a document, or if you want to get a list of all categories, it is recommended to use a special one.categoryDetailInterface (Get detailed category information by category ID or alias) orcategoryListInterface (Get multiple category lists), these interfaces will provide more accurate and lightweight data according to your specific needs.

Related articles

If the document is a product type, how can you get its `price` (price) and `stock` (stock) information?

In Anqi CMS, if you are managing documents of product types and need to obtain specific price (`price`) and stock (`stock`) information for these products, it is actually very direct and convenient.The design of AnQi CMS considers such needs, making these key data as one of the core attributes of the document, you can easily obtain them through several core interfaces.### Get the price and stock information of a single product document When you need to view the price and stock of a specific product, AnQi CMS provides the `archiveDetail` interface

2025-11-09

The value of the `status` field in the document details, for example 1, specifically indicates which display status the document has?

When using AnQi CMS to manage website content, you may encounter various technical parameters, one of which seems simple but is crucial is the `status` field in the document details.It acts like a 'switch' for the content, quietly controlling whether your article, product, or other information can be seen by visitors. Then, what does this `status` field specifically represent?In simple terms, it is an integer value used to mark the current display state of the document.

2025-11-09

Is the `created_time` and `updated_time` field of the document in Unix timestamp, how to perform time format conversion?

In AnQiCMS (AnQiCMS), when you obtain various information such as documents, categories, attachments, and users through the API interface, you will find that fields like `created_time` (creation time) and `updated_time` (update time) are usually presented in integer form.This is indeed the Unix timestamp format commonly used by many systems, including AnQiCMS.### What is Unix timestamp? Unix timestamp, also known as POSIX time or Epoch time, is a way to represent time

2025-11-09

What is the role of `canonical_url` and `fixed_link` in document details for SEO and link management?

In website operation, the health status of links and the friendliness to search engines are the foundation for the success of the website.AnQi CMS provides us with two key fields: `canonical_url` and `fixed_link`, which play a crucial role in document details and help us optimize the search engine performance of the website and effectively manage links. ### canonical_url: Define the "main version" of the content Imagine that your website might have multiple URLs pointing to the same or highly similar content for various reasons.

2025-11-09

How to display the `extra` object, how to access its `name` and `value`?

When using AnQiCMS to manage website content, the flexibility of custom fields in the document model is one of its highlights.These custom fields allow us to add unique properties for different types of documents (such as articles, products, etc.), greatly enriching the content dimensions.When obtaining document details or lists through the API, the information of these custom fields is cleverly encapsulated in the `extra` object of the returned data.

2025-11-09

How to get the value of a specific custom field (such as "author") through the `extra` field?

In Anqi CMS, the custom fields of documents are a reflection of its powerful flexibility, allowing us to add various unique attributes to content, thereby enabling more precise management and display of information.But for many developers and operations personnel, how to accurately obtain the values of these custom fields through the API is often a clear issue.Don't worry, Anqi CMS provides clear paths in API design, through the `extra` field, you can easily handle these additional data.### Understand the `extra` field

2025-11-09

What does it mean if an error code 1001 or 1002 occurs when getting the document details, and how to solve it?

When using AnQi CMS for website content management and development, we often use API interfaces to obtain various data, among which obtaining document details (`/api/archive/detail`) is very commonly used.When you call this interface, if you encounter system return codes 1001 or 1002, it usually indicates that the request was not successfully processed and a specific reason is given.Understanding the meaning and solutions of these error codes can help us more efficiently troubleshoot problems and ensure the normal display of website content.### Error Code 1001

2025-11-09

Does the document detail interface directly provide the detailed content of the document's category (`category.content`)?

When using AnQi CMS for website development or content integration, it is often necessary to obtain documents and their related information.One of the common questions is: When getting the details of a document, can we also get the detailed content of the category to which the document belongs, especially fields like `category.content`?According to the documents provided by AnQi CMS, we can clearly find the answer.To be direct, **yes, the AnQi CMS document detail interface (`/api/archive/detail`) indeed provides detailed content of the document's category

2025-11-09