In AnQiCMS, efficiently managing and displaying content is the core of website operation.Sometimes, you may need to display all the articles published by a specific author together, such as creating an author column, team member introduction page, or personal portfolio.AnQiCMS powerful template tag system provides a flexible way to meet this requirement, allowing you to easily filter and display the content list of specific authors.
This article will introduce you to how to display the list of articles published by a specific author in AnQiCMS, helping you better organize your website content.
Understanding the relationship between authors and articles in AnQiCMS
In AnQiCMS management system, whenever you publish an article, the system will associate it with the user who published the article.This means that the article data will include a user ID to identify the publisher.This user ID is the key to our precise filtering of articles by specific authors.archiveListTags provideuserIdParameter, used specifically to retrieve a list of articles based on user ID.
Preparation: Retrieve the user ID of the author
Before writing template code, we need to know the unique user ID of the article author in the AnQiCMS system.
You can log in to the AnQiCMS backend and go to the "Administrator Management" or "User Management" module.Here, you will see the list of all registered users or administrators.Each user corresponds to a unique digital ID.123.
Core Implementation: UsearchiveListTag filtering articles
AnQiCMSarchiveListLabels are the core tools for retrieving article lists, supporting various filtering conditions. To display articles by a specific author, we will focus on using itsuserIdParameter.
1. Basic article list display
First, in your template file (such as a special one for displaying author informationauthor_profile.html, or in some area of the existing article list pagearchiveListuse the tag to retrieve article data.
The following is a basic code example, it will retrieve the ID of `1