How to Display Elements During a Specific Period
Using the "from ~ , days/weeks/months/years" display condition based on the CMS "Publication Date" property, you can show elements for specific periods.
Use Cases
Display a "NEW" badge on blog posts published within the last week
Show a badge on limited-time price items for 3 days
Display a "Recommended" mark on campaign products for one month
This article will guide you through displaying a "NEW" badge on both article detail pages and article lists, but only for posts published within the last week.
Tips: Currently, publication date is the only property that supports date-based display conditions. To show elements for a specific period from a particular date, you'll need to edit the publication date.
Setup Instructions
Prerequisites
Please refer to these articles to create your article detail pages and article lists beforehand:
Step 1. Adding the "NEW" Badge
Place the "NEW" badge on your article detail page or article list:
Drag and drop a text box from the left add panel
Type "NEW"
Adjust styling (font size, color, background color) using the settings panel
Step 2. Setting Display Conditions
Select the "NEW" badge
Open the right settings panel and click [Set Display Conditions]
Configure display conditions: Select [Publication Date] from properties and set the period to [Week]
Step 3. Testing
Use Live Preview to confirm the "NEW" badge appears only on items within the specified period from their publication date.
You can modify article publication dates in the CMS dashboard as needed for testing.
Once you've confirmed the CMS items are "Published" and everything works correctly, publish or update your site to reflect changes on the live site.