Browse Source

标签修改

moshaorui 3 weeks ago
parent
commit
12c89404c0
1 changed files with 8 additions and 2 deletions
  1. 8 2
      app/Services/LiquidTags/LiquidTagCollection.php

+ 8 - 2
app/Services/LiquidTags/LiquidTagCollection.php

@@ -65,9 +65,15 @@ class LiquidTagCollection extends AbstractBlock
         if (!$pages) {
             return ''; // 如果没有找到页面,返回空字符串
         }
-
+        $pages = [];
+        if ($pages->items()) {
+            $pages = $pages->items()->toArray();
+            foreach ($pages->items() as $item) {
+                $pages['tabs'] = $item->tabs->toArray();
+            }
+        }
         // 如果有文章,渲染模板
-        return $this->renderTemplate(['pages' => $pages->items()]);
+        return $this->renderTemplate(['pages' => $pages]);
     }
 
     // 渲染模板