2022-03-14 14:56:35 +01:00
|
|
|
<?php namespace ProcessWire;
|
|
|
|
|
2023-02-21 14:48:37 +01:00
|
|
|
/** @var Page $page API variable */
|
2022-03-14 14:56:35 +01:00
|
|
|
|
2023-02-21 14:48:37 +01:00
|
|
|
$menu = '';
|
|
|
|
$contido = '';
|
|
|
|
|
|
|
|
if($configuracion['mantemento']['activo'] && !$user->isLoggedin())
|
2022-03-14 14:56:35 +01:00
|
|
|
{
|
2023-02-21 14:48:37 +01:00
|
|
|
$menu = renderMenu($pages->get('/noticias')->and($pages->get('/contacto')));
|
2022-03-14 14:56:35 +01:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2023-02-21 14:48:37 +01:00
|
|
|
$menu = renderMenu($inicio->children);
|
|
|
|
}
|
2022-10-25 14:47:38 +02:00
|
|
|
|
2023-02-21 14:48:37 +01:00
|
|
|
$categorias = pages()->get('/noticias/categorias/')->children();
|
|
|
|
$etiquetas = pages()->get('/noticias/etiquetas/')->children();
|
2022-10-25 14:47:38 +02:00
|
|
|
|
2023-02-21 14:48:37 +01:00
|
|
|
$contido .= renderMigasPan($page) . "\n";
|
|
|
|
$contido .= '<article id="' . $page->name .'" class="container">' . "\n";
|
|
|
|
$contido .= '<h2 class="visually-hidden">' . ucfirst($page->title) . '</h2>' . "\n";
|
|
|
|
$contido .= '<section class="row row-cols-1 row-cols-md-2 mb-3">' . "\n";
|
|
|
|
$contido .= renderCategoriasEtiquetas($categorias);
|
|
|
|
$contido .= renderCategoriasEtiquetas($etiquetas);
|
|
|
|
$contido .= '</section>' . "\n";
|
|
|
|
$contido .= '<section id="publicacions" class="row row-cols-1 row-cols-lg-2 mb-3">' . "\n";
|
2022-10-25 14:47:38 +02:00
|
|
|
|
2023-02-21 14:48:37 +01:00
|
|
|
if($page->numChildren)
|
|
|
|
{
|
|
|
|
$publicacions = pages()->get('/noticias/publicacions/')->children("template='publicacion',sort=-data_publicacion,limit=10");
|
2022-10-25 14:47:38 +02:00
|
|
|
|
2023-02-21 14:48:37 +01:00
|
|
|
$contido .= renderPaxinacion($publicacions, 'superior');
|
2022-10-25 14:47:38 +02:00
|
|
|
|
2023-02-21 14:48:37 +01:00
|
|
|
foreach($publicacions as $publicacion)
|
|
|
|
{
|
|
|
|
$contido .= renderArtigos($publicacion, $languages->getLocale());
|
2022-10-25 14:47:38 +02:00
|
|
|
}
|
2023-02-21 14:48:37 +01:00
|
|
|
|
|
|
|
$contido .= renderPaxinacion($publicacions, 'inferior');
|
|
|
|
}
|
|
|
|
$contido .= '</section>' . "\n";
|
|
|
|
$contido .= '</article>' . "\n";
|