43 lines
No EOL
1.4 KiB
PHP
43 lines
No EOL
1.4 KiB
PHP
<?php namespace ProcessWire;
|
|
|
|
/** @var Page $page API variable */
|
|
|
|
$menu = '';
|
|
$contido = '';
|
|
|
|
if($configuracion['mantemento']['activo'] && !$user->isLoggedin())
|
|
{
|
|
$menu = renderMenu($pages->get('/noticias')->and($pages->get('/contacto')));
|
|
}
|
|
else
|
|
{
|
|
$menu = renderMenu($inicio->children);
|
|
}
|
|
|
|
$categorias = pages()->get('/noticias/categorias/')->children();
|
|
$etiquetas = pages()->get('/noticias/etiquetas/')->children();
|
|
|
|
$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";
|
|
|
|
if($page->numChildren)
|
|
{
|
|
$publicacions = pages()->get('/noticias/publicacions/')->children("template='publicacion',sort=-fecha_publicacion,limit=10");
|
|
|
|
$contido .= renderPaxinacion($publicacions, 'superior');
|
|
|
|
foreach($publicacions as $publicacion)
|
|
{
|
|
$contido .= renderArtigos($publicacion, $languages->getLocale());
|
|
}
|
|
|
|
$contido .= renderPaxinacion($publicacions, 'inferior');
|
|
}
|
|
$contido .= '</section>' . "\n";
|
|
$contido .= '</article>' . "\n"; |