{set $current_url = $.server.REQUEST_URI | stripTags}
{if $current_url == '/explore/published' || $current_url == '/explore/published/'}
{set $latest = ('!getCache' | snippet : [
'cacheKey' => 'wopc-published',
'cacheElementKey' => 'latest-month-year',
'element' => 'pdoResources',
'elementClass' => 'modSnippet',
'cacheExpires' => 3600,
'parents' => 0,
'limit' => 1,
'template' => 8,
'sortby' => 'publishedon',
'context' => 'web,epcs',
'showHidden' => 0,
'sortdir' => 'DESC',
'return' => 'data',
'includeTVs' => '',
'showLog' => 0,
'select' => 'publishedon',
'tpl' => '@INLINE [[+publishedon]]'
])}
{set $latestTimestamp = $latest[0].publishedon}
{set $year = $latestTimestamp | date : 'Y'}
{set $month = $latestTimestamp | date : 'F' | lower}
{else}
{* Check for missing year/month FIRST before any template output - prevents undefined key errors *}
{if !$published_year || !$published_month}
{set $latest = ('!getCache' | snippet : [
'cacheKey' => 'wopc/explore/published',
'cacheElementKey' => 'latest-month-year-redirect',
'element' => 'pdoResources',
'elementClass' => 'modSnippet',
'cacheExpires' => 3600,
'parents' => 0,
'limit' => 1,
'template' => 8,
'sortby' => 'publishedon',
'context' => 'web,epcs',
'showHidden' => 0,
'sortdir' => 'DESC',
'return' => 'data',
'includeTVs' => '',
'showLog' => 0,
'select' => 'publishedon',
'tpl' => '@INLINE [[+publishedon]]'
])}
{set $latestTimestamp = $latest[0].publishedon ?: ''}
{set $redirectYear = $latestTimestamp | date : 'Y'}
{set $redirectMonth = $latestTimestamp | date : 'F' | lower}
{else}
{set $tableData = '!getExplorebyPublished' | snippet : [
'year' => $published_year ?: '',
'month' => $published_month ?: ''
]}
{* Validate and safely encode JSON data for JavaScript output *}
{if $tableData && $tableData != '[]' && $tableData != ''}
{* Use base64 encoding to safely pass JSON through template *}
{set $jsonDataBase64 = $tableData | base64_encode}
{else}
{set $jsonDataBase64 = '[]' | base64_encode}
{/if}
{$totalitems ?: ''}
[[!+page.nav]]
{/if}
{/if}
Published
Browse by article publication date
{$published_year ?: ''} • {$published_month ?: ''}
{'!published.get.years' | snippet : [
'cacheKey' => 'wopc/explore/published/years',
'cacheElementKey' => 'years',
'element' => 'published.get.years',
'cacheExpires' => 2,
'debug' => 0
]}
{set $start_date = strtotime("1 {$published_month ?: 'january'} {$published_year ?: date('Y')}")}
{set $end_date = strtotime("last day of {$published_month ?: 'january'} {$published_year ?: date('Y')} 23:59:59")}
| Image | Details | Year | Country | Published |
|---|