diff --git a/app/taglib/HcTaglib.php b/app/taglib/HcTaglib.php index 6a75948..6c3e9ba 100644 --- a/app/taglib/HcTaglib.php +++ b/app/taglib/HcTaglib.php @@ -690,7 +690,13 @@ parse; */ public function tagContentPage($tag, $content): string { - $cid = !empty($_GET['cid']) ? $_GET['cid'] : (empty($tag['cid']) ? '' : (int)$tag['cid']); + $cid = !empty($_GET['cid']) ? (int)$_GET['cid'] : (empty($tag['cid']) ? '' : $tag['cid']); + if (strpos($cid, '$') === 0) { + // cid 为模板变量(如 cid="$ui_invest_learn"),运行时解析 + $this->autoBuildVar($cid); + } else { + $cid = (int)$cid; + } $keywords = empty($_GET['keywords']) ? '' : $_GET['keywords']; $item = empty($tag['item']) ? 'vo' : $tag['item']; $mainField = empty($tag['mainField']) ? '*' : $tag['mainField']; @@ -715,7 +721,7 @@ parse; $parse = << '{$cid}', + 'cid' => {$cid}, 'item' => '{$item}', 'mainField' => '{$mainField}', 'subField' => '{$subField}', @@ -741,7 +747,7 @@ parse; $parse = << '{$cid}', + 'cid' => {$cid}, 'item' => '{$item}', 'mainField' => '{$mainField}', 'subField' => '{$subField}', diff --git a/public/themes/website/1/en/demo/download.html b/public/themes/website/1/en/demo/download.html index 9812370..929bc52 100755 --- a/public/themes/website/1/en/demo/download.html +++ b/public/themes/website/1/en/demo/download.html @@ -119,7 +119,9 @@
{hcTaglib:contentPage mainField="*" subField="*" name="hc_content" limit="12" item="vo" sort="sort desc"} {php} - $dl_file = !empty($vo['url']) ? $vo['url'] : ($vo['thumbnail']['url'] ?? ''); + // $dl_file = !empty($vo['url']) ? $vo['url'] : ($vo['thumbnail']['url'] ?? ''); + $pdf_resource_download = $vo['main_content']['resource_download'][0] ?? ''; + $dl_file = $pdf_resource_download['url'] ?? ''; $has_dl = $dl_file !== ''; {/php}
diff --git a/public/themes/website/1/zh/demo/components/footer.html b/public/themes/website/1/zh/demo/components/footer.html index 153acff..027db34 100755 --- a/public/themes/website/1/zh/demo/components/footer.html +++ b/public/themes/website/1/zh/demo/components/footer.html @@ -59,9 +59,8 @@
diff --git a/public/themes/website/1/zh/demo/download.html b/public/themes/website/1/zh/demo/download.html index da4b199..5fb634a 100755 --- a/public/themes/website/1/zh/demo/download.html +++ b/public/themes/website/1/zh/demo/download.html @@ -120,6 +120,8 @@ {hcTaglib:contentPage mainField="*" subField="*" name="hc_content" limit="12" item="vo" sort="sort desc"} {php} $dl_file = !empty($vo['url']) ? $vo['url'] : ($vo['thumbnail']['url'] ?? ''); + $pdf_resource_download = $vo['main_content']['resource_download'][0] ?? ''; + $dl_file = $pdf_resource_download['url'] ?? ''; $has_dl = $dl_file !== ''; {/php}