[ 'path' => '../../resources' ] ]; $cms = cms($ECMS_Item_options); $item = $cms->item($ECMS_Item_sourcePath, $ECMS_Item_slug, [ 'page_path' => $ECMS_Item_pagePath, 'pretty_urls' => $ECMS_Item_prettyUrls ]); // This is for local preview mode, usually when previewing a template page // In that case, we can use the first file in the directory as a fallback if (!$item && $ECMS_LOCAL_PREVIEW) { if (is_dir($ECMS_Item_sourcePath)) { // get the first file in the directory $files = glob($ECMS_Item_sourcePath . '/*.{md,markdown,txt}', GLOB_BRACE); if (!empty($files)) { $ECMS_Item_slug = pathinfo($files[0], PATHINFO_FILENAME); $item = $cms->item($ECMS_Item_sourcePath, $ECMS_Item_slug, [ 'page_path' => $ECMS_Item_pagePath, 'pretty_urls' => $ECMS_Item_prettyUrls ]); } } } // Make $item available globally for use in portals and other templates $GLOBALS['ECMS_Item_rw7A48ED39_5EE6_49C5_BC3E_89EBF00A7989'] = $item; // log an error if the item is not found if (!$item) { error_log('CMS Item not found: ' . $ECMS_Item_sourcePath . ' ' . $ECMS_Item_slug); } })(); // End IIFE ?> CMS $collectionPath, 'page_path' => $pagePath, 'pretty_urls' => $prettyUrls, 'title' => htmlspecialchars('Adam Sébire : Arctic climate change artist - filmmaker - photographer - ', ENT_QUOTES, 'UTF-8'), 'description' => htmlspecialchars('RSS feed for ', ENT_QUOTES, 'UTF-8'), 'link' => 'https://www.adamsebire.info' ]; $rssURL = $apiPath . '/cms/rss?' . http_build_query($rssURLParams); $sitemapURLParams = [ 'content_path' => $collectionPath, 'page_path' => $pagePath, 'pretty_urls' => $prettyUrls, 'base_url' => 'https://www.adamsebire.info' ]; $sitemapURL = $apiPath . '/cms/sitemap?' . http_build_query($sitemapURLParams); if ($wantsRSS) { echo ''; } if ($wantsSitemap) { echo ''; } })(); ?>

New website under construction; please bear with us as content is transferred from the old site during December 2025...

alt testq
is_array($_GET['tags'] ?? '') ? $_GET['tags'] : array_filter(array_map('trim', explode(',', $_GET['tags'] ?? ''))), default => array_filter(array_map('trim', explode(',', ''))) }; if (!empty($tags)) { $filters['tags'] = implode(',', $tags); } } // Author filtering $filterAuthor = "all"; if ($filterAuthor !== 'all') { $author = match ($filterAuthor) { 'url' => is_array($_GET['author'] ?? '') ? $_GET['author'] : array_filter(array_map('trim', explode(',', $_GET['author'] ?? ''))), default => array_filter(array_map('trim', explode(',', ''))) }; if (!empty($author)) { $filters['author'] = implode(',', $author); } } // Featured filtering $filterFeatured = "all"; if ($filterFeatured !== 'all') { $filters['featured'] = $filterFeatured === 'true' ? 'true' : 'false'; } // Status filtering $filterStatus = "published"; if ($filterStatus !== 'all') { $filters['status'] = $filterStatus; } else { $filters['status'] = 'published'; // Default to published only } // Date filtering - handled via API query parameters $filterDate = "past"; if ($filterDate === 'past') { $filters['date_before'] = date('Y-m-d H:i:s'); } elseif ($filterDate === 'future') { $filters['date_after'] = date('Y-m-d H:i:s'); } $orderBy = "date"; $orderDirection = "desc"; // Build collection query using fluent API with URL configuration $ECMS_options = [ 'resources' => [ 'path' => '../../resources' ] ]; $query = cms($ECMS_options)->collection($collectionPath) ->pagePath($pagePath) ->tagPagePath('') ->authorPagePath('') ->prettyUrls($prettyUrls) ->orderBy($orderBy, $orderDirection); // Apply all filters foreach ($filters as $key => $value) { switch ($key) { case 'tags': $query = $query->tags($value); break; case 'author': $query = $query->author($value); break; case 'featured': $query = $query->featured($value === 'true'); break; case 'status': $query = $query->status($value); break; case 'date_before': $query = $query->before($value); break; case 'date_after': $query = $query->after($value); break; } } // Execute query with pagination try { $collection = $query ->paginate($currentPage, $itemsPerPage) ->get(); $items = $collection->items; $pagination = $collection->pagination; } catch (Exception $e) { $items = []; $pagination = (object) [ 'current_page' => 1, 'total_pages' => 1, 'total_items' => 0, 'items_per_page' => $itemsPerPage, 'has_prev' => false, 'has_next' => false ]; } // Create collection-like object for backward compatibility $collectionObj = new class($items, $pagination) { public $items; public $pagination; public function __construct($items, $pagination) { $this->items = $items; $this->pagination = $pagination; } public function each($callback) { foreach ($this->items as $item) { $callback($item); } } }; // Collection data is now available in template scope $collection = $collectionObj; ?> $collection->pagination, 'items' => $collection->items, 'collection' => $collection, 'filters' => $filters, 'orderBy' => $orderBy, 'orderDirection' => $orderDirection, 'collectionPath' => $collectionPath, 'pagePath' => $pagePath, 'itemsPerPage' => $itemsPerPage, 'prettyUrls' => $prettyUrls, 'collectionItemTemplateId' => $collectionItemTemplateId ?? null ]); ?>
each(function ($item) use ($collection, $collectionItemTemplate, $filters, $orderBy, $orderDirection, $collectionPath, $pagePath, $itemsPerPage, $prettyUrls, $collectionItemTemplateId) { echo renderTemplate($collectionItemTemplate, [ 'item' => $item, 'collection' => $collection, 'filters' => $filters, 'orderBy' => $orderBy, 'orderDirection' => $orderDirection, 'collectionPath' => $collectionPath, 'pagePath' => $pagePath, 'itemsPerPage' => $itemsPerPage, 'prettyUrls' => $prettyUrls, 'collectionItemTemplateId' => $collectionItemTemplateId ]); }); // Output the template for use in frontend Alpine components echo ''; ?>
$collection->pagination, 'items' => $collection->items, 'collection' => $collection, 'filters' => $filters, 'orderBy' => $orderBy, 'orderDirection' => $orderDirection, 'collectionPath' => $collectionPath, 'pagePath' => $pagePath, 'itemsPerPage' => $itemsPerPage, 'prettyUrls' => $prettyUrls, 'collectionItemTemplateId' => $collectionItemTemplateId ]); ?>
wrapper around {{item.body}} since body already contains HTML $itemTemplate = str_replace('

{{item.body}}

', '{{item.body}}', $itemTemplate); if ($item) { echo renderTemplate($itemTemplate, ['item' => $item]); } else { // @TODO: Add a "Not Found" template (or redirect option) echo 'No item found'; } ?>
alt testq