CMSBanner
Banner Object
Cấu trúc đối tượng Banner quảng cáo.
Schema
{
"company_id": 1,
"creator_id": 5,
"id": 50,
"source": 1,
"mode": 1,
"title": "Summer Sale 2024",
"description": "Chương trình khuyến mãi mùa hè",
"identifier": "home-hero-banner",
"width": 1920,
"height": 600,
"column_desktop": 1,
"column_mobile": 1,
"background_color": "#ffffff",
"slide_autoplay": 1,
"slide_delay": 5000,
"column_gap": 0,
"row_gap": 0,
"rounded_size": "8px",
"transition_effect": "fade",
"transition_direction": "horizontal",
"aspect_ratio_desktop": "16/9",
"aspect_ratio_mobile": "4/3",
"show_navigation": 1,
"show_pagination": 1,
"link_href": "/collections/summer-sale",
"link_target": "_self",
"classname": "hero-section",
"status": 1,
"date_created": 1700000000,
"date_modified": 1700005000,
"images": [
{
"company_id": 1,
"creator_id": 5,
"banner_id": 50,
"id": 1001,
"screen_mode": 1,
"link": "/product-1",
"target": "_self",
"alt_text": "Banner 1",
"title": "Banner 1",
"file_id": 9001,
"file": {
"id": 9001,
"url": "https://example.com/banner1.jpg"
// ... File Object
},
"display_order": 1,
"status": 1,
"hero_content": "",
"hero_placement": "",
"hero_buttons": [],
"date_created": 1700000000,
"date_modified": 1700005000
}
]
}Field Descriptions
| Tên trường | Kiểu dữ liệu | Mô tả |
|---|---|---|
id | integer | ID Banner |
identifier | string | Định danh duy nhất để Frontend gọi |
title | string | Tiêu đề nhóm Banner |
mode | integer | Chế độ hiển thị (1: Slider, 3: Grid) |
source | integer | Nguồn (1: Manual, 3: Page Block) |
width, height | integer | Kích thước đề xuất |
aspect_ratio_desktop | string | Tỉ lệ khung hình máy tính |
aspect_ratio_mobile | string | Tỉ lệ khung hình điện thoại |
description | string | Mô tả |
column_desktop, column_mobile | integer | Số cột hiển thị trên desktop / mobile |
background_color | string | Màu nền |
slide_autoplay | integer | Tự động chạy slide (1: bật, 0: tắt) |
slide_delay | integer | Thời gian chuyển slide |
column_gap, row_gap | integer | Khoảng cách giữa các cột / hàng |
rounded_size | string | Độ bo góc |
transition_effect, transition_direction | string | Hiệu ứng và hướng chuyển slide |
show_navigation, show_pagination | integer | Hiện nút điều hướng / chấm phân trang |
link_href, link_target | string | Liên kết chung của Banner và target |
classname | string | CSS class tuỳ chỉnh |
images | array | Danh sách các ảnh chi tiết trong Banner (Enriched, sắp theo display_order) |
status | integer | Trạng thái (1: Enable, 3: Disabled) |
date_created, date_modified | integer | Unix timestamp ngày tạo / cập nhật |
Banner Image Fields (In images array)
| Tên trường | Kiểu dữ liệu | Mô tả |
|---|---|---|
id | integer | ID ảnh |
banner_id | integer | ID Banner chứa ảnh |
screen_mode | integer | Màn hình hiển thị (1: Tất cả, 3: Chỉ desktop, 5: Chỉ mobile) |
file_id | integer | ID file ảnh |
file | object | Thông tin file ảnh (có url) |
link | string | Đường dẫn khi click vào ảnh |
target | string | Thuộc tính target của liên kết (ví dụ _self, _blank) |
alt_text | string | Alt text của ảnh |
title | string | Tiêu đề ảnh (Caption) |
display_order | integer | Thứ tự hiển thị trong slide/grid |
status | integer | Trạng thái (1: Enable, 3: Disabled) — API chỉ trả ảnh đang Enable |
hero_content | string | Nội dung hero hiển thị trên ảnh |
hero_placement | string | Vị trí đặt nội dung hero |
hero_buttons | array | Danh sách nút trong khối hero |
date_created | integer | Unix timestamp ngày tạo |
date_modified | integer | Unix timestamp ngày cập nhật |