Files
Gnuboard7/templates/_bundled/sirsoft-basic/layouts/shop/index.json
T
HeuJung 0dfb45951b fix(core,basic): 검색 봇 화면 렌더러 패리티 결손 일괄 수정
일반 화면(React)과 봇 화면(PHP)은 같은 레이아웃을 각각 렌더하는데 봇
화면 쪽 지원 범위가 뒤처져, 확장이 교체한 본문이 통째로 빈 채 나갔다
(공개 이슈 ). 같은 결손 계열을 전수 조사해 함께 닫는다.

- 확장 주입 props 를 렌더 진입 시점에 해석해 자손 전체에 상속
 → 게시글·답글 원글·댓글·페이지·상품 설명 5개 지점 복구
- 사용자 작성 HTML 정화기 신설 — isHtml 판정에 따라 이스케이프/정화.
 미정화 상태에서 봇 경로로 저장형 스크립트가 실제 실행됐다
- 노드 키 패리티: conditions / type:iterator / responsive 매칭 규칙 /
 children 문자열 / text 우선순위 / $t:defer / 레이아웃 초기 상태
- 표현식: 단일 바인딩 판정 교체, ||·&& 를 값 반환(JS 시맨틱)으로,
 비교식이 raw 경로에서 null 이 되던 문제
- 데이터소스: 엔드포인트 표현식 전면 해석 + 레이아웃 8곳 선언 보강
- 봇 페이지 캐시 1회 전량 무효화 업그레이드 스텝

지원 범위 SSoT 표를 문서에 고정하고, 한쪽만 고치는 것을 막는 검사 룰과
레이아웃 전수 순회 테스트로 잠갔다.
2026-07-27 10:03:06 +09:00

277 lines
12 KiB
JSON

{
"version": "1.0.0",
"layout_name": "shop/index",
"permissions": [],
"extends": "_user_base",
"meta": {
"seo": {
"enabled": true,
"extensions": [
{ "type": "module", "id": "sirsoft-ecommerce" }
],
"data_sources": ["products", "categories", "popularProducts", "newProducts"],
"page_type": "shop_index",
"toggle_setting": "$module_settings:sirsoft-ecommerce:seo.seo_shop_index",
"vars": {
"site_name": "$core_settings:general.site_name",
"shopBase": "$module_settings:sirsoft-ecommerce:basic_info.route_path"
},
"priority": 0.7,
"changefreq": "daily",
"og": {
"type": "website",
"title": "{{_seo.shop_index.title ?? ''}}"
},
"structured_data": {
"@type": "ItemList",
"name": "{{_seo.shop_index.title ?? ''}}",
"description": "{{_seo.shop_index.description ?? ''}}"
}
}
},
"init_actions": [
{
"handler": "loadFromLocalStorage",
"params": {
"key": "recentProductIds",
"defaultValue": []
},
"resultTo": {
"target": "_global",
"key": "recentProductIds"
}
}
],
"errorHandling": {
"401": {
"comment": "비회원 상품 조회 권한 없음 — 토스트 대신 상태 플래그로 안내 배너 표시",
"handler": "setState",
"params": {
"target": "local",
"productAccessDenied": true
}
},
"403": {
"comment": "인증된 사용자 상품 조회 권한 없음",
"handler": "setState",
"params": {
"target": "local",
"productAccessDenied": true
}
}
},
"data_sources": [
{
"id": "categories",
"label_key": "$t:editor.data_source.categories",
"type": "api",
"endpoint": "/api/modules/sirsoft-ecommerce/categories",
"method": "GET",
"auto_fetch": true,
"loading_strategy": "progressive",
"fallback": {
"data": []
}
},
{
"id": "products",
"label_key": "$t:editor.data_source.products",
"type": "api",
"endpoint": "/api/modules/sirsoft-ecommerce/products",
"method": "GET",
"auth_mode": "optional",
"params": {
"page": "{{query.page ?? 1}}",
"per_page": 12,
"category_id": "{{query.category ?? ''}}",
"sort": "{{query.sort ?? 'latest'}}",
"search": "{{query.keyword ?? ''}}"
},
"auto_fetch": true,
"loading_strategy": "progressive",
"fallback": {
"data": [],
"meta": {
"current_page": 1,
"last_page": 1,
"per_page": 12,
"total": 0
}
}
},
{
"id": "recentProducts",
"label_key": "$t:editor.data_source.recentProducts",
"type": "api",
"endpoint": "/api/modules/sirsoft-ecommerce/products/recent",
"method": "GET",
"auth_mode": "optional",
"params": {
"ids": "{{(_global.recentProductIds ?? []).join(',')}}"
},
"auto_fetch": true,
"loading_strategy": "progressive",
"fallback": {
"data": []
}
},
{
"id": "popularProducts",
"label_key": "$t:editor.data_source.popularProducts",
"type": "api",
"endpoint": "/api/modules/sirsoft-ecommerce/products/popular?limit=8",
"method": "GET",
"auth_mode": "optional",
"auto_fetch": true,
"loading_strategy": "progressive",
"fallback": {
"data": []
}
},
{
"id": "newProducts",
"label_key": "$t:editor.data_source.newProducts",
"type": "api",
"endpoint": "/api/modules/sirsoft-ecommerce/products/new?limit=8",
"method": "GET",
"auth_mode": "optional",
"auto_fetch": true,
"loading_strategy": "progressive",
"fallback": {
"data": []
}
}
],
"slots": {
"content": [
{
"type": "layout",
"name": "Container",
"props": {
"className": "py-8"
},
"children": [
{
"type": "basic",
"name": "Div",
"props": {
"className": "mb-6"
},
"children": [
{
"type": "basic",
"name": "H1",
"props": {
"className": "text-2xl font-bold text-gray-900 dark:text-white flex items-center gap-2"
},
"children": [
{
"type": "basic",
"name": "Icon",
"props": {
"name": "shopping-cart",
"className": "text-2xl"
}
},
{
"type": "basic",
"name": "Span",
"text": "$t:shop.title"
}
]
},
{
"type": "basic",
"name": "P",
"props": {
"className": "text-gray-600 dark:text-gray-400 mt-1"
},
"text": "$t:shop.description"
}
]
},
{
"comment": "상품 조회 권한 없음 안내 배너",
"type": "basic",
"name": "Div",
"if": "{{_local.productAccessDenied === true}}",
"props": {
"className": "mb-6 p-4 bg-yellow-50 dark:bg-yellow-900/20 border border-yellow-200 dark:border-yellow-800 rounded-lg flex items-center gap-3"
},
"children": [
{
"type": "basic",
"name": "Icon",
"props": {
"name": "triangle-exclamation",
"className": "text-yellow-600 dark:text-yellow-400"
}
},
{
"type": "basic",
"name": "Span",
"props": {
"className": "text-yellow-800 dark:text-yellow-200 text-sm"
},
"text": "$t:sirsoft-ecommerce.shop.product_access_denied"
}
]
},
{
"comment": "최상위 카테고리 버튼 (전체 + 1단계 카테고리)",
"type": "basic",
"name": "Div",
"props": { "className": "flex flex-wrap gap-2 mb-4" },
"children": [
{
"type": "basic",
"name": "Button",
"props": {
"className": "{{!query.category ? 'px-3 py-1.5 bg-gray-900 dark:bg-white text-white dark:text-gray-900 rounded-full text-sm font-medium' : 'px-3 py-1.5 bg-gray-50 dark:bg-gray-700 border border-gray-300 dark:border-gray-600 text-gray-700 dark:text-gray-300 rounded-full text-sm hover:bg-gray-100 dark:hover:bg-gray-600'}}"
},
"text": "$t:shop.category.all",
"actions": [
{ "comment": "audit:allow layout-list-context-navigate-merge-query 카테고리 '전체' 선택 — 카테고리 필터를 푸는 의도적 리셋이므로 병합하지 않는다", "type": "click", "handler": "navigate", "params": { "path": "{{_global.shopBase}}/products", "query": {} } }
]
},
{
"type": "basic",
"name": "Div",
"iteration": { "source": "{{categories?.data ?? []}}", "item_var": "cat" },
"children": [
{
"type": "basic",
"name": "Button",
"props": {
"className": "{{query.category == cat?.id ? 'px-3 py-1.5 bg-gray-900 dark:bg-white text-white dark:text-gray-900 rounded-full text-sm font-medium' : 'px-3 py-1.5 bg-gray-50 dark:bg-gray-700 border border-gray-300 dark:border-gray-600 text-gray-700 dark:text-gray-300 rounded-full text-sm hover:bg-gray-100 dark:hover:bg-gray-600'}}"
},
"text": "{{cat?.name_localized}}",
"actions": [
{ "comment": "audit:allow layout-list-context-navigate-merge-query 카테고리 전환 — 다른 목록으로의 이동이라 이전 카테고리의 검색·정렬 상태를 승계하지 않는다", "type": "click", "handler": "navigate", "params": { "path": "{{_global.shopBase}}/products", "query": { "category": "{{cat?.id}}", "page": "1" } } }
]
}
]
}
]
},
{
"partial": "partials/shop/list/_search_filter_bar.json"
},
{
"partial": "partials/shop/list/_product_grid.json"
},
{
"partial": "partials/shop/list/_recent_products.json"
},
{
"partial": "partials/shop/list/_popular_products.json"
},
{
"partial": "partials/shop/list/_new_products.json"
}
]
}
]
}
}