From a17c578433ef543e220697813a9367a260df83e1 Mon Sep 17 00:00:00 2001
From: Jake Vanderwerf <get@jakevanderwerf.ca>
Date: Thu, 28 May 2026 19:14:31 +0000
Subject: [PATCH] =new gitblit setup

---
 content/strategy.php |   71 +++++++++++++++++++++++++----------
 1 files changed, 51 insertions(+), 20 deletions(-)

diff --git a/content/strategy.php b/content/strategy.php
index 2a99027..e603a5c 100644
--- a/content/strategy.php
+++ b/content/strategy.php
@@ -2,6 +2,7 @@
 // /content/strategy.php
 use JVBase\meta\Meta;
 use JVBase\registrar\Registrar;
+use JVBase\utility\Image;
 
 if (!defined('ABSPATH')) {
     exit;
@@ -15,6 +16,7 @@
 add_filter('ajv_StrategySchemaDefault', 'ajv_strategy_schema');
 add_filter('ajv_StrategyMetaDefault', 'ajv_strategy_meta');
 add_filter('ajv_StrategyArchiveDefault', 'ajv_strategy_archive');
+add_filter('ajv_StrategyExtras', 'ajv_strategy_extras');
 
 function ajv_strategy(){
     if (!class_exists('JVBase\registrar\Registrar')) {
@@ -131,6 +133,23 @@
     ]);
 }
 
+function ajv_strategy_extras(array $extras):array
+{
+    return [[
+        'type'          => 'JVBase\managers\SEO\render\Thing\Intangible\Service',
+        'id'            => get_post_type_archive_link(BASE.'strategy').'#service',
+        'name'          => 'Best Brand Strategy in Edmonton, Alberta',
+        'description'   => 'Brand strategy services Canadian strategist Jake Vanderwerf.
+        From SEO services to developing your brand identity, target market - or whatever it takes to bring your business to the next level.',
+        'url'           => get_post_type_archive_link(BASE.'strategy'),
+        'provider'      => ['id' => get_home_url(null, '#localbusiness')],
+        'areaServed'    => [
+            '@type' => 'JVBase\managers\SEO\render\Thing\Place\AdministrativeArea\Country',
+            'name'  => 'Canada'
+        ],
+    ]];
+}
+
 //function ajv_strategy():array
 //{
 //    return [
@@ -296,7 +315,8 @@
 //}
 
 
-function ajv_render_strategy_content(array $block, string $content):string
+
+function ajv_prerender_strategy_content(array $block, ?string $content, ?WP_Block $parent):?string
 {
     $out = '';
     $ID = get_the_ID();
@@ -304,42 +324,53 @@
 
     $fields = $meta->getAll();
 
+
+
     $bits = [];
-    if (array_key_exists('post_excerpt', $fields) && !empty($fields['post_excerpt'])) {
-        $bits[] = sprintf(
-            '<section id="excerpt"><h2>At a Glance</h2>%s</section>',
-            jvb_filter_content($fields['post_excerpt'])
+    $excerpt = '';
+
+    $rows = [];
+    foreach (['project', 'form', 'city', 'style', 'theme'] as $type) {
+
+        if (!empty($fields[$type])) {
+            $rows[] = jvbMetaTermList($fields[$type], $type);
+        }
+
+    }
+    if (!empty($rows)) {
+        $excerpt .= sprintf(
+            '<ul class="summary">%s</ul>',
+            implode('', array_map(function ($row) {
+                return '<li>'.$row.'</li>';
+            }, $rows))
         );
     }
 
-    if (array_key_exists('gallery', $fields) && !empty($fields['gallery'])) {
-        $gallery = explode(',',$fields['gallery']);
-        $gallery = array_map(function ($imgID) {
-            $out = '<figure>'.jvbFormatImage($imgID,'tiny','medium');
-            $caption = wp_get_attachment_caption($imgID);
-            $out .= ($caption && $caption !== '') ? '<figcaption>'.jvb_filter_content($caption).'</figcaption>' : '';
-            $out .= '</figure>';
-            return $out;
+    if (!empty($fields['post_excerpt']??'')) {
+        $excerpt .= wpautop($fields['post_excerpt']);
+    }
+    if (!empty($excerpt)) {
+        $bits[] = sprintf('<section id="summary"><h3>At a Glance</h3>%s</section>',$excerpt);
+    }
 
-        }, $gallery);
-        $gallery = implode('',$gallery);
+    if (!empty($fields['gallery']??'')) {
         $bits[] = sprintf(
-            '<section id="gallery"><h2>Gallery</h2><div>%s</div></section>',
-            $gallery
+            '<section id="gallery"><h2>Gallery</h2>%s</section>',
+            Image::gallery($fields['gallery'])
         );
     }
 
-    if (array_key_exists('post_content', $fields) && !empty($fields['post_content'])) {
+    if (!empty($fields['post_content']??'')) {
         $bits[] = sprintf(
             '<section id="content">%s</section>',
             $fields['post_content']
         );
     }
 
-    if (array_key_exists('needs', $fields) && !empty($fields['needs'])) {
+    if (!empty($fields['needs']??'')) {
         $bits[] = ajvb_format_needs($fields['needs']);
     }
-    if (array_key_exists('wants', $fields) && !empty($fields['wants'])) {
+    if (!empty($fields['wants']??'')) {
         $bits[] = ajvb_format_wants($fields['wants']);
     }
 

--
Gitblit v1.10.0