The use of images is a key factor in enhancing the attractiveness of the webpage during website content operation.Especially the thumbnail, it plays the role of a 'facade' in scenarios such as list pages, recommendation slots, and so on.However, in the process of daily content publishing, sometimes the thumbnail may be missing due to negligence or the content itself not containing images, which not only affects the aesthetics and professionalism of the page, but may also reduce the desire of users to click. 幸运的是,AnqiCMS has provided us with a comprehensive solution to ensure that even if the document does not upload a thumbnail, the page can elegantly display a default placeholder image.

Understand the thumbnail processing mechanism of AnqiCMS

Before going deeper into setting the default placeholder, we first need to understand the logic of AnqiCMS handling document thumbnails. AnqiCMS has a set of built-in priorities when displaying thumbnails:

  1. Manually upload or select an image:When we are editing documents, categories, or single pages, if a picture is explicitly uploaded as a thumbnail (for example, in the 'Add Document' interface's 'Document Picture' section), the system will prioritize using this picture.
  2. Automatically extract the first image from the content:If no thumbnail is manually specified, but the document content (such as the article text) contains images, AnqiCMS will intelligently extract the first image in the content as the thumbnail.This feature greatly simplifies the thumbnail management of some content.

However, when a document does not have a manually uploaded thumbnail and there are no images available for extraction in the content, the original thumbnail display position may appear blank, affecting user experience.To fill this blank, AnqiCMS provides an option to set a global default placeholder image.

Set default placeholder: core steps

Ensure that all documents display a unified default placeholder image when there is no dedicated thumbnail, we need to make a simple configuration in the AnqiCMS backend management system. Here are the specific steps:

  1. Log in to the backend management system:Log in to the AnqiCMS backend using the administrator account and password.
  2. Enter the content settings:Find the item "Backend Settings" in the left navigation menu, click to expand, and select "Content Settings".
  3. Configure the default thumbnail:On the "Content Settings" page, you will see an option named "Default Thumbnail". This is where you upload or select the image you wish to be used as the default placeholder for the website.
  4. Upload and save:Click the corresponding button to select a pre-prepared, moderately sized, and uniformly styled image as the default thumbnail.This image should have universality and be able to serve as a placeholder for various content.After uploading, be sure to click the 'Save' button at the bottom of the page to make the configuration effective.

After completing these steps, AnqiCMS will remember this image.Future documents that do not specify a thumbnail image will automatically refer to the default image you set here when a thumbnail is needed.

Seamless connection of calling and displaying in the template:

The template tag design of AnqiCMS is very intelligent, no additional template modification is needed for the default thumbnail. When you usearchiveDetailto get the document details (throughname="Thumb"orname="Logo"), or inarchiveList/categoryList/pageListCall in loopitem.Thumboritem.LogoWhen the field is used, the system will automatically judge according to the priority mentioned before:

  • If the document has a manually uploaded thumbnail, it will display the thumbnail.
  • If no image is manually uploaded but an image exists in the content, then the first image in the content is displayed.
  • If neither of the above two conditions is met, the system will display the default thumbnail you have configured in the "Content Settings".

This means that as long as you correctly set the default thumbnail, all existing template tags will automatically adapt, ensuring that there will be no blank space due to missing thumbnails on the page, which greatly reduces the burden of template development and content maintenance.

Further optimize the default image display experience

In addition to setting the default thumbnail itself, we can also combine other options in the "Content Settings" to make the display of the default placeholder image even more perfect:

  • Thumbnail size and processing method:In the 'Content Settings', you can configure the 'thumbnail size' and 'thumbnail processing method' for all thumbnails (such as 'proportionally scaled by the longest side', 'cropped by the shortest side', etc.).These settings also apply to the default thumbnail.According to the design requirements of the website, preset an appropriate size and choose a suitable processing method to ensure that the default placeholder image can be presented in a unified and beautiful way in different scenarios.
  • Batch regenerate thumbnails:If you set or modify the default thumbnail after operating the website for a period of time, and want to adjust some existing thumbnails (especially those that may not be of high quality or not meet the size specifications) uniformly according to the new rules, you can use the 'Batch Regenerate Thumbnails' feature.This is very helpful to ensure the visual consistency of images throughout the site.

Summary

To set a default placeholder thumbnail for the AnqiCMS website is a simple and efficient content operation strategy.It can effectively avoid page defects caused by missing thumbnails, maintain the professional image of the website, and enhance the user browsing experience.