Compare commits

...

5 Commits

Author SHA1 Message Date
2ab43d2615 MODIF backend segundo idioma 2025-08-21 07:21:55 +00:00
472bc00677 ADD segundo idioma 2025-08-21 07:21:36 +00:00
03e45ed783 MODIFY Styles 2025-08-13 08:59:42 +00:00
23e613546a MODIFY single pages 2025-08-13 08:59:26 +00:00
223bca3767 MODIFY searcher 2025-08-13 08:58:35 +00:00
36 changed files with 932 additions and 551 deletions

View File

@ -13,7 +13,6 @@ use Timber\Timber;
// Load Composer dependencies.
require_once __DIR__ . '/vendor/autoload.php';
Timber::init();
new StarterSite();

View File

@ -16,14 +16,18 @@ Timber::render( 'templates/page.twig', $context );*/
$context = Timber::context();
$timber_post = Timber::get_post();
$context['post'] = $timber_post;
$context['search_query'] = get_search_query();
//Timber::render( array( 'templates/page-' . $timber_post->post_name . '.twig', 'page.twig' ), $context );
// Verificar si es subpágina de contactos
$parent = get_post($timber_post->post_parent);
if ($parent && $parent->post_name === 'contactos') {
if ($parent && $parent->post_name === 'contactos' || $parent->post_name === 'kontaktua' ) {
// Para subpáginas de contactos, usar page-contactos.twig
Timber::render('templates/page-contactos.twig', $context);
} elseif ($parent && $parent->post_name === 'servicios-privados' || $parent && $parent->post_name === 'servicios-publicos') {
// Para subpáginas de servicios privados, usar page-servicio-individual.twig
Timber::render('templates/single-servicios.twig', $context);
} else {
// Para el resto, usar la lógica original
Timber::render(array('templates/page-' . $timber_post->post_name . '.twig'), $context);

View File

@ -9,10 +9,6 @@ use Timber\Timber;
$templates = [ 'templates/search.twig', 'templates/archive.twig', 'templates/index.twig' ];
$context = Timber::context(
[
'title' => 'Search results for ' . get_search_query(),
]
);
$context = Timber::context([]);
Timber::render( $templates, $context );

View File

@ -32,7 +32,17 @@ class StarterSite extends Site {
add_filter('upload_mimes', [$this, 'add_svg_support']); //add svg files
add_filter('timber/context', [$this, 'add_global_context']); // variables globales
add_filter('timber/twig', [$this, 'add_videos_embed_to_twig']); //videos embed
add_action('pre_get_posts', array($this, 'exclude_pages_from_search')); //exclude pages with ACF
add_action('init', function() {
if (function_exists('pll_current_language')) {
// Forzar que ACF reconozca el idioma actual
add_filter('acf/settings/current_language', function() {
return pll_current_language();
});
}
});
parent::__construct();
}
@ -203,13 +213,23 @@ class StarterSite extends Site {
return $file_types;
}
//section "portada"
private function getBotonesImagen() {
//section "portada> ENLACES"
private function getBotonesImagen($page_id = null) {
if (is_null($page_id)) {
$page_id = get_the_ID();
// Si estamos en euskera, obtener la página en español
if (pll_current_language() == 'eu') {
$spanish_page_id = pll_get_post($page_id, 'es');
$page_id = $spanish_page_id ?: $page_id;
}
}
$botones = [];
for ($i = 1; $i <= 4; $i++) {
$imagen = get_field('imagen_boton_' . $i);
$enlace = get_field('enlace_boton_' . $i);
$imagen = get_field('imagen_boton_' . $i, $page_id);
$enlace = get_field('enlace_boton_' . $i, $page_id);
$botones[] = [
'imagen' => $imagen,
@ -254,7 +274,7 @@ class StarterSite extends Site {
for ($i = 1; $i <= $max_logos; $i++) {
$logoHeader = get_field('logo_header_' . $i, 'option');
$textoHeader = get_field('texto_header_' . $i, 'option');
if ($logoHeader || $textoHeader) {
$logos[] = [
'logo' => $logoHeader,
@ -284,6 +304,49 @@ class StarterSite extends Site {
'orderby' => 'date',
'order' => 'DESC'
]);
// $current_lang = pll_current_language();
// // Consulta con filtro de idioma
// $posts = Timber::get_posts([
// 'post_type' => 'opinion',
// 'posts_per_page' => 1,
// 'post_status' => 'publish',
// 'orderby' => 'date',
// 'order' => 'DESC',
// 'lang' => $current_lang // ← Filtro por idioma
// ]);
// // Debug temporal - quítalo después
// $debug_all = Timber::get_posts([
// 'post_type' => 'opinion',
// 'posts_per_page' => -1,
// 'post_status' => 'publish'
// ]);
// $debug_spanish = Timber::get_posts([
// 'post_type' => 'opinion',
// 'posts_per_page' => -1,
// 'post_status' => 'publish',
// 'lang' => 'es'
// ]);
// $debug_euskera = Timber::get_posts([
// 'post_type' => 'opinion',
// 'posts_per_page' => -1,
// 'post_status' => 'publish',
// 'lang' => 'eu'
// ]);
// // Logging temporal
// error_log("=== DEBUG ARTICULOS OPINION ===");
// error_log("Idioma actual: " . $current_lang);
// error_log("Total artículos opinion: " . count($debug_all));
// error_log("Artículos en español: " . count($debug_spanish));
// error_log("Artículos en euskera: " . count($debug_euskera));
// error_log("Resultado consulta actual: " . count($posts));
// return $posts;
}
private function getCampanaArticles() {
@ -354,32 +417,35 @@ class StarterSite extends Site {
'post_status' => 'publish',
'orderby' => 'menu_order',
'order' => 'ASC',
'posts_per_page' => -1,
'posts_per_page' => -1,
]);
}
//Obtiene los "Documentos"
private function getDocumentos() {
$posts = Timber::get_posts([
$args = ([
'post_type' => 'documento',
'post_status' => 'publish',
'orderby' => 'menu_order',
'order' => 'ASC',
'posts_per_page' => -1,
'lang' => '',
]);
//error_log('✅ Número de posts "Documentos" encontrados: ' . count($posts));
$posts = Timber::get_posts($args);
$documentos = [];
foreach ($posts as $post) {
$doc = [
'id' => $post->ID,
'title' => $post->title,
'link' => $post->link,
'content' => $post->content,
'excerpt' => $post->excerpt,
'id' => $post->ID,
'title' => $post->title,
'link' => $post->link,
'content' => $post->content,
'excerpt' => $post->excerpt,
'lang' => pll_get_post_language($post->ID),
];
$archivo = get_field('documento', $post->ID);
@ -398,14 +464,14 @@ class StarterSite extends Site {
return $documentos;
}
/**
* Obtiene los grupos de enlaces de la página "Enlaces"
*/
/** Obetiene campos de "Enlaces" */
private function getEnlaces() {
$grupos = [];
// Buscar página por su slug
$page = get_page_by_path('enlaces');
// Buscar página por su slug & Cambia dinámicamente según idioma
$page = get_page_by_path( pll_current_language() === 'eu' ? 'loturak' : 'enlaces' );
//error_log('✅ Página "enlaces" encontrada con ID: ' . $page->ID);
if (!$page) {
error_log('🔴 Página "enlaces" no encontrada con get_page_by_path().');
@ -424,7 +490,6 @@ class StarterSite extends Site {
$field = get_field('grupos_enlaces', $page->ID);
//error_log('📦 Contenido de get_field: ' . print_r($field, true));
//error_log('✅ Página "enlaces" encontrada con ID: ' . $page->ID);
while (have_rows('grupos_enlaces', $page->ID)) {
the_row();
@ -472,6 +537,8 @@ class StarterSite extends Site {
if (!$pag_servicios_publicos) {
error_log('🔴 Página "Servicios públicos" no encontrada.');
return [];
} else {
//error_log('✅ Página "Servicios públicos" encontrada.');
}
$subpaginas = Timber::get_posts([
@ -499,6 +566,8 @@ class StarterSite extends Site {
if (!$pag_servicios_privados) {
error_log('🔴 Página "Servicios privados" no encontrada.');
return [];
} else {
//error_log('✅ Página "Servicios privados" encontrada.');
}
$subpaginas = Timber::get_posts([
@ -518,9 +587,57 @@ class StarterSite extends Site {
return $subpaginas;
}
private function getSubpaginasServicios() {
// Detectar automáticamente si es servicios públicos o privados
$current_post = get_post();
$slug_actual = $current_post->post_name;
// Determinar qué página padre buscar según el slug actual
if ($slug_actual === 'servicios-publicos') {
$path = 'accion-sindical/servicios-publicos';
$tipo = 'publicos';
} elseif ($slug_actual === 'servicios-privados') {
$path = 'accion-sindical/servicios-privados';
$tipo = 'privados';
} else {
return [];
}
$pag_servicios = get_page_by_path($path);
if (!$pag_servicios) {
error_log("🔴 Página '$path' no encontrada.");
return [];
}
$subpaginas = Timber::get_posts([
'post_type' => 'page',
'post_status' => 'publish',
'post_parent' => $pag_servicios->ID,
'orderby' => 'menu_order',
'order' => 'ASC',
'posts_per_page' => -1,
]);
foreach ($subpaginas as $pagina) {
$pagina->thumbnail = get_the_post_thumbnail_url($pagina->ID);
$pagina->tipo_servicio = $tipo; // Para usar en la plantilla si necesitas distinguir
}
return $subpaginas;
}
//Campos de contactos
public function getContactoFields() {
$post = Timber::get_post();
if (!$post) {
error_log('🔴 No hay páginas de contactos.');
return []; // devolver un array vacío para evitar el error
}
$form_shortcode = get_field('etiqueta_formulario', $post->ID); // o el campo ACF donde esté el shortcode
//error_log('✅ ID Página "Contactos": ' . $post->ID);
$contactsFields = [
'nombre' => get_field('nombre_contacto', $post->ID),
@ -537,21 +654,55 @@ class StarterSite extends Site {
}
public function getAfiliateFields() {
$post = Timber::get_post();
// Excluir páginas de la búsqueda
public function exclude_pages_from_search($query) {
if (!is_admin() && $query->is_main_query() && $query->is_search()) {
$query->set('meta_query', array(
'relation' => 'OR',
array(
'key' => 'exclude_from_search',
'compare' => 'NOT EXISTS'
),
array(
'key' => 'exclude_from_search',
'value' => '1',
'compare' => '!='
)
));
}
}
// Añadir idiomas de Polylang
private function getPolylangData() {
$polylang_data = array();
if (function_exists('pll_the_languages')) {
// Idiomas con toda la información
$polylang_data['languages'] = pll_the_languages(array(
'raw' => 1,
'hide_if_no_translation' => 0,
'show_flags' => 1,
'show_names' => 1
));
// Información del idioma actual
$polylang_data['current_language'] = pll_current_language();
$polylang_data['current_language_name'] = pll_current_language('name');
$polylang_data['default_language'] = pll_default_language();
$afiliateFields = [
'imagen_afiliate' => get_field('imagen_afiliate', $post->ID),
'enlace_boton_afiliate' => get_field('enlace_boton_afiliate', $post->ID),
'texto_boton' => get_field('texto_boton', $post->ID),
];
if (empty($afiliateFields['imagen_afiliate']) && empty($afiliateFields['enlace_boton_afiliate'])) {
return null;
}
return $afiliateFields;
// DEBUG: Escribir en el log de errores
//error_log('Languages: ' . print_r($polylang_data['languages'], true));
//error_log('Current language: ' . $polylang_data['current_language']);
//error_log('Default language: ' . $polylang_data['default_language']);
// URLs de home para cada idioma
$polylang_data['home_urls'] = array();
foreach ($polylang_data['languages'] as $lang) {
$polylang_data['home_urls'][$lang['slug']] = $lang['url'];
}
}
return $polylang_data;
}
//Global variables
@ -560,7 +711,7 @@ class StarterSite extends Site {
$context['footer_1'] = get_field('footer_text_1', 'option');
$context['footer_2'] = get_field('footer_text_2', 'option');
$context['recent_posts_noticias'] = $this->recentPostsNews();
$context['botones_imagen'] = $this->getBotonesImagen();
$context['botones_imagen'] = $this->getBotonesImagen(); //ENLACES
$context['redes_sociales'] = $this->getIconsRRSS();
$context['logos_header'] = $this->getLogosHeader();
$context['videos'] = $this->getVideos();
@ -572,7 +723,9 @@ class StarterSite extends Site {
$context['subpaginas_servicios_publicos'] = $this->getPaginasServiciosPublicos();
$context['subpaginas_servicios_privados'] = $this->getPaginasServiciosPrivados();
$context['contacto_info'] = $this->getContactoFields();
$context['afiliate_fields'] = $this->getAfiliateFields();
//$context['afiliate_fields'] = $this->getAfiliateFields();
$context = array_merge($context, $this->getPolylangData());
$context['subpaginas_servicios'] = $this->getSubpaginasServicios();
return $context;
}

233
style.css
View File

@ -9,6 +9,8 @@
--rojo-cnt-dark: #9d1b1d;
--rojo-cnt-light: #d6453f;
--reset: #7b7b7b;
--white:#fff;
--black:#000000ff;
}
@font-face {
@ -19,12 +21,17 @@
font-display: swap;
}
/* PORTADA -> ENLACES */
.margin-50 {
margin: 50px 0 !important;
}
/* Botón primario */
.btn-primary-cnt {
border-radius: 75px !important;
background-color: var(--rojo-cnt);
border: 2px solid var(--rojo-cnt);
color: white;
color: var(--white);
padding: 10px 20px;
font-size: 16px;
font-weight: 600;
@ -35,10 +42,11 @@
/* Botón primario - hover */
.btn-primary-cnt:hover {
background-color: var(--rojo-cnt-dark);
border-color: var(--rojo-cnt-dark);
color: var(--black);
background-color: white;
border-color: var(--black);
transform: translateY(-2px);
box-shadow: 0 4px 8px rgba(255, 0, 0, 0.25);
box-shadow: 0 4px 8px rgba(0, 0, 0, 0.25);
}
/* Botón primario - active */
@ -56,7 +64,7 @@ button[type="reset"] {
border-radius: 10px !important;
background-color: var(--rojo-cnt-light);
border: 2px solid var(--rojo-cnt-light);
color: white;
color: var(--white);
padding: 10px;
font-size: 16px;
font-weight: 600;
@ -67,10 +75,11 @@ button[type="reset"] {
/* Botón secundario - hover */
.btn-secondary-cnt:hover {
background-color: var(--rojo-cnt-light);
border-color: var(--rojo-cnt-light);
color: var(--black);
background-color: var(--white);
border-color: var(--black);
transform: translateY(-2px);
box-shadow: 0 4px 8px rgba(255, 0, 0, 0.25);
box-shadow: 0 4px 8px rgba(0, 0, 0, 0.25);
}
/* Botón secundario - active */
@ -89,12 +98,34 @@ button[type="reset"] {
outline: none !important;
box-shadow: none !important;
background-color: var(--rojo-cnt) !important;
color: white !important;
color: var(--white) !important;
opacity: 0.5;
}
/* PORTADA -> Titles */
.sp-module-title::after{
background: var(--rojo-cnt);
content: "";
height: 3px;
left: 0;
position: absolute;
bottom: -5px;
width: 150px;
}
.sp-module-title::before{
background: var(--black);
content: "";
height: 3px;
left: 0;
position: absolute;
bottom: -12px;
width: 150px;
}
/* HEADER sindikatua */
.text-sindikatua {
.text-sindikatua,
.sp-module-title {
font-family: 'Yaro', Arial, sans-serif;
}
@ -127,7 +158,7 @@ button[type="reset"] {
}
/* PORTADA -> CARDS recent posts 'noticias' */
.recent-posts .card-img-overlay {
.page-portada .recent-posts .card-img-overlay {
top: auto !important; /* Anula el top: 0 por defecto de Bootstrap */
bottom: 0;
height: 25%;
@ -137,7 +168,7 @@ button[type="reset"] {
}
/* PORTADA -> CARDS OPINION */
.opinion-article .card-img-overlay {
.page-portada .opinion-article .card-img-overlay {
top: auto !important; /* Anula el top: 0 por defecto de Bootstrap */
bottom: 0;
height: 30%;
@ -146,21 +177,26 @@ button[type="reset"] {
align-items: center;
}
.page-portada .opinion-article .card-img-overlay:hover,
.page-portada .recent-posts .card-img-overlay:hover {
background: rgba(0, 0, 0, 0.8);
}
@media (991px <= width < 1400px) {
.opinion-article .card-img-overlay {
.page-portada .opinion-article .card-img-overlay {
height: 40%;
}
}
@media (width < 990px) {
.opinion-article .card-img-overlay {
.page-portada .opinion-article .card-img-overlay {
height: 20%;
}
}
.recent-posts .card-title,
.opinion-article .card-title {
color: white;
.page-portada .recent-posts .card-title,
.page-portada .opinion-article .card-title {
color: var(--white);
margin: 0;
font-weight: 600;
text-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
@ -172,53 +208,52 @@ button[type="reset"] {
text-overflow: ellipsis;
}
.recent-posts .card-title a,
.opinion-article .card-title a {
color: white;
.page-portada .recent-posts .card-title a,
.page-portada .opinion-article .card-title a {
color: var(--white);
text-decoration: none;
transition: color 0.3s ease;
}
.recent-posts .card-title a:hover {
.page-portada .recent-posts .card-title a:hover {
color: var(--rojo-cnt);
}
.recent-posts .card.secondary-article .card-title {
.page-portada .recent-posts .card.secondary-article .card-title {
font-size: medium;
}
@media (max-width: 768px) {
.recent-posts .card-img-overlay {
.page-portada .recent-posts .card-img-overlay {
height: 18%;
}
.recent-posts .card-title {
.page-portada .recent-posts .card-title {
font-size: 0.9rem;
}
.recent-posts .media-mb {
.page-portada .recent-posts .media-mb {
margin-bottom: 1rem; /* o el valor que necesites */
}
}
/* PORTADA -> Titles */
.sp-module-title::after{
background: var(--rojo-cnt);
content: "";
height: 1px;
left: 0;
position: absolute;
bottom: -12px;
width: 150px;
/* PORTADA -> ENLACES */
.btn-hover .btn-image-only {
overflow: hidden;
border-radius: 0.375rem;
transition: box-shadow 0.3s ease;
width: fit-content;
}
.sp-module-title::before{
background: var(--rojo-cnt);
content: "";
height: 1px;
left: 0;
position: absolute;
bottom: -15px;
width: 150px;
.btn-hover .btn-image-only img {
transition: transform 0.3s ease;
}
.btn-hover:hover .btn-image-only {
box-shadow: 0 0 15px var(--rojo-cnt);
}
.btn-hover:hover .btn-image-only img {
transform: scale(1.08);
}
/* PORTADA -> SECTION VIDEO */
@ -234,8 +269,23 @@ button[type="reset"] {
width: 100%;
}
/* FOOTER */
/* noticias */
.page-portada .img-noticias,
.posts-noticias .img-noticias {
transition: filter 0.3s ease;
}
.page-portada .img-noticias:hover,
.posts-noticias .img-noticias:hover {
filter: grayscale(100%);
}
.posts-noticias .card-title-text:hover {
font-weight: bolder;
}
/* FOOTER */
/* Convert SVG RRSS white */
.svg-white {
filter: brightness(0) invert(1);
@ -246,14 +296,14 @@ button[type="reset"] {
}
.btn-outline-white {
color: white;
border-color: white;
color: var(--white);
border-color: var(--white);
background-color: transparent;
}
.btn-outline-white:hover {
background-color: white;
border-color: white;
background-color: var(--white);
border-color: var(--white);
}
.svg-hover-white:hover {
@ -271,6 +321,10 @@ button[type="reset"] {
height: auto;
}
.servicios .card .card-body .card-title {
width: fit-content;
}
.enlaces button:not(.collapsed) {
background-color: var(--rojo-cnt);
color: #fff;
@ -346,7 +400,7 @@ button[type="reset"] {
border-radius: 25px !important;
background-color: var(--rojo-cnt);
border: 2px solid var(--rojo-cnt);
color: white;
color: var(--white);
padding: 15px 30px;
font-size: 18px;
font-weight: 600;
@ -419,3 +473,86 @@ button[type="reset"] {
padding: 12px 25px;
}
}
/* Texto sección tease.twig */
.link-underline-animate {
position: relative;
text-decoration: none;
transition: color 0.3s ease;
}
.link-underline-animate::after {
content: "";
position: absolute;
bottom: 0;
left: 50%;
width: 0;
height: 2px;
background-color: var(--rojo-cnt); /* color del subrayado */
transition: all 0.3s ease;
transform: translateX(-50%);
}
.link-underline-animate:hover {
color: var(--rojo-cnt) !important; /* color del texto al hacer hover */
}
.link-underline-animate:hover::after {
width: 100%;
}
/* search page */
.offcanvas-body {
height: 18vh!important; /* altura del 18% del viewport */
}
/* Resetear estilos de Bootstrap en la paginación */
.pagination-block .pagination {
margin-bottom: 0;
}
.pagination-block .page-item {
display: flex;
align-items: center;
margin: 0; /* Resetear margin por defecto */
}
/* Estilos específicos para números de página */
.page-number {
padding: 10px 15px !important;
min-width: 44px;
text-align: center;
border-color: var(--reset);
background-color: var(--reset);
border-radius: 10px;
color: var(--white);
}
.current-page {
border-radius: 75px !important; /* Mismo border-radius que activos */
}
.btn-pagination-position {
display: inline-flex;
align-items: end;
justify-content: center;
min-height: 44px;
}
.btn-no-hover {
transition: none !important;
pointer-events: none;
cursor: default !important;
}
.btn-page-hover:hover {
color: var(--black);
background-color: var(--white);
border-color: var(--black);
transform: translateY(-2px);
box-shadow: 0 4px 8px rgba(0, 0, 0, 0.25);
}
a.btn-page-hover:hover {
border: 2px solid var(--black) !important;
}

View File

@ -48,7 +48,7 @@
{% endif %}
<div class="wrapper">
{% block content %}
Sorry, no content
Lo siento, no hay contenido.
{% endblock %}
</div>
</section>

View File

@ -1,16 +1,18 @@
<button class="btn btn-light" type="button" data-bs-toggle="offcanvas" data-bs-target="#offcanvasTop" aria-controls="offcanvasTop">
<i class="bi bi-search"></i>
</button>
<section class="section-search">
<button class="btn btn-light" type="button" data-bs-toggle="offcanvas" data-bs-target="#offcanvasTop" aria-controls="offcanvasTop">
<i class="bi bi-search"></i>
</button>
<div class="offcanvas offcanvas-top" tabindex="-1" id="offcanvasTop" aria-labelledby="offcanvasTopLabel">
<div class="offcanvas-header">
<h5 class="offcanvas-title" id="offcanvasTopLabel">Búsqueda</h5>
<button type="button" class="btn-close" data-bs-dismiss="offcanvas" aria-label="Close"></button>
</div>
<div class="offcanvas-body">
<form class="d-flex mt-3" role="search">
<input class="form-control me-2" type="search" placeholder="Search" aria-label="Search"/>
<button class="btn btn-outline-success" type="submit">Search</button>
</form>
</div>
</div>
<div class="offcanvas offcanvas-top mt-3" tabindex="-1" id="offcanvasTop" aria-labelledby="offcanvasTopLabel" style="max-height: 18vh;">
<div class="offcanvas-header">
<h5 class="offcanvas-title" id="offcanvasTopLabel">Búsqueda</h5>
<button type="button" class="btn-close" data-bs-dismiss="offcanvas" aria-label="Close"></button>
</div>
<div class="offcanvas-body">
<form class="d-flex mt-3" role="search" method="get" action="/">
<input class="form-control me-2" type="search" name="s" placeholder="Buscar..." aria-label="Search"/>
<button class="btn btn-primary-cnt" type="submit">Buscar</button>
</form>
</div>
</div>
</section>

View File

@ -25,17 +25,29 @@
{% include "menu.twig" with {'items': menu.get_items} %}#}
</div>
<div class="col-sm-3 mb-5">
</div>
<div class="col-sm-3">
<h2>Contactos</h2>
{% if function('pll_current_language') == 'eu' %}
<h2>Kontaktua</h2>
{% else %}
<h2>Contactos</h2>
{% endif %}
</div>
</div>
<div class="py-2 text-center">
<p class="mb-0 fs-8">&bullet; Todos los derechos reservados &bullet; {{"now"|date('Y')}}</p>
<a class="nav-link d-inline" href="/politica-de-privacidad">Aviso legal y política de privacidad &bullet;</a>
<a class="nav-link d-inline" href="/politica-de-cookies">Política de cookies</a>
<div class="py-2 text-center mt-5 border-top border-light">
{% if function('pll_current_language') == 'eu' %}
<p>Web orri honen edukia Creative Commons Aitortu-Partekatu Berdin 4.0 Nazioarteko lizentzia baten pean dago, kanpoko iturri bat adierazten denean izan ezik.</p>
<p class="mb-0 fs-8">&bullet; Eskubide guztiak erreserbatuta &bullet; {{"now"|date('Y')}}</p>
<a class="nav-link d-inline" href="/politica-de-privacidad">Lege oharra eta pribatutasun politika &bullet;</a>
<a class="nav-link d-inline" href="/politica-de-cookies">Cookien politika</a>
{% else %}
<p>El contenido de esta página web está bajo una licencia Creative Commons Reconocimiento-Compartir Igual 4.0 Internacional excepto aquel en el que se indique una fuente externa.</p>
<p class="mb-0 fs-8">&bullet; Todos los derechos reservados &bullet; {{"now"|date('Y')}}</p>
<a class="nav-link d-inline" href="/politica-de-privacidad">Aviso legal y política de privacidad &bullet;</a>
<a class="nav-link d-inline" href="/politica-de-cookies">Política de cookies</a>
{% endif %}
</div>
</div>

View File

@ -1,43 +1,60 @@
{% if posts.pagination.pages is not empty %}
<nav class="pagination-block">
<nav class="pagination-block d-flex justify-content-center">
<ul class="pagination">
{# First #}
{% if (posts.pagination.pages|first) and posts.pagination.pages|first.current != true %}
<li class="first btn">
<a href="{{ posts.pagination.pages|first.link }}">First</a>
<li class="first mx-2 border border-0">
<a href="{{ posts.pagination.pages|first.link }}" class="text-decoration-none btn-primary-cnt btn-pagination-position btn-page-hover">Inicio</a>
</li>
{% else %}
<li class="first btn disabled"><button disabled>First</button></li>
<li class="first disabled mx-2 border border-0" >
<button disabled class="btn-secondary-cnt btn-pagination-position btn-no-hover">Inicio</button>
</li>
{% endif %}
{# Previous #}
{% if posts.pagination.prev %}
<li class="prev btn"><a href="{{ posts.pagination.prev.link }}">Previous</a></li>
<li class="prev mx-2 border border-0">
<a href="{{ posts.pagination.prev.link }}" class="text-decoration-none btn-primary-cnt btn-pagination-position btn-page-hover">Anterior</a>
</li>
{% else %}
<li class="prev btn disabled"><button disabled>Previous</button></li>
<li class="prev disabled mx-2 border border-0">
<button disabled class="btn-secondary-cnt btn-pagination-position btn-no-hover">Anterior</button>
</li>
{% endif %}
{# Pages #}
{% for page in posts.pagination.pages %}
{% if page.link %}
<li><a href="{{ page.link }}" class="{{ page.class }}">{{ page.title }}</a></li>
<li class="mx-2 btn-pagination-position">
<a href="{{ page.link }}" class="{{ page.class }} text-decoration-none btn-page-hover" >{{ page.title }}</a>
</li>
{% else %}
<li class="current"><span class="{{ page.class }}">{{ page.title }}</span></li>
<li class="current mx-2 btn-pagination-position">
<span class="{{ page.class }}">{{ page.title }}</span>
</li>
{% endif %}
{% endfor %}
{# Next #}
{% if posts.pagination.next %}
<li class="next btn"><a href="{{ posts.pagination.next.link }}">Next</a></li>
<li class="next mx-2 border border-0">
<a href="{{ posts.pagination.next.link }}" class="text-decoration-none btn-primary-cnt btn-pagination-position btn-page-hover">Siguiente</a>
</li>
{% else %}
<li class="next btn disabled"><button disabled>Next</button></li>
<li class="next disabled mx-2 border border-0">
<button disabled class="btn-secondary-cnt btn-pagination-position btn-no-hover">Siguiente</button>
</li>
{% endif %}
{# Last #}
{% if (posts.pagination.pages|last) and posts.pagination.pages|last.current != true %}
<li class="last btn"><a href="{{ posts.pagination.pages|last.link }}">Last</a></li>
<li class="last mx-2 border border-0">
<a href="{{ posts.pagination.pages|last.link }}" class="text-decoration-none btn-primary-cnt btn-pagination-position btn-page-hover">Última</a></li>
{% else %}
<li class="last btn disabled"><button disabled>Last</button></li>
<li class="last disabled mx-2 border border-0">
<button disabled class="btn-secondary-cnt btn-pagination-position btn-no-hover">Última</button>
</li>
{% endif %}
</ul>
</nav>

View File

@ -1,157 +1,153 @@
<section class="py-4">
<div class="container">
<div class="row align-items-stretch">
{# Primera columna - Carousel con vídeos embebidos #}
<div class="col-lg-8 col-12 mb-4 mb-lg-0">
<p class="mb-4 position-relative fs-4 fw-bold sp-module-title">VÍDEOS</p>
<div class="row align-items-stretch">
{# Primera columna - Carousel con vídeos embebidos #}
<div class="col-lg-8 col-12 mb-4 mb-lg-0">
<h1 class="mb-4 position-relative fs-4 fw-bold sp-module-title">{{ __('Vídeos', 'Sindikatua')|upper }}</h1>
{% if videos %}
<div id="videosCarousel" class="carousel slide" data-bs-ride="carousel">
<div class="carousel-inner">
{% for pair in videos|batch(2, null) %}
{% if videos %}
<div id="videosCarousel" class="carousel slide" data-bs-ride="carousel">
<div class="carousel-inner">
{% for pair in videos|batch(2, null) %}
<div class="carousel-item {% if loop.first %}active{% endif %}">
<div class="row">
{% for video in pair %}
{% if video %}
<div class="col-6">
<div class="video-item">
{% set url_video = video.meta('url_video') %}
{% set video_data = generar_embed(url_video) %}
{% if video_data %}
{# Thumbnail clickeable en lugar del iframe #}
<div class="ratio ratio-16x9 video-thumbnail-container position-relative rounded"
data-bs-toggle="modal"
data-bs-target="#videoModal"
data-video-url="{{ video_data.embed_url }}"
data-video-title="{{ video.titulo }}"
data-video-allow="{{ video_data.allow }}"
style="cursor: pointer;
background-image: url('{{ video_data.thumbnail_url }}');
background-size: cover;
background-position: center;">
<div class="carousel-item {% if loop.first %}active{% endif %}">
<div class="row">
{% for video in pair %}
{% if video %}
<div class="col-6">
<div class="video-item">
{% set url_video = video.meta('url_video') %}
{% set video_data = generar_embed(url_video) %}
{% if video_data %}
{# Overlay con botón play #}
<div class="position-absolute top-0 start-0 w-100 h-100 d-flex align-items-center justify-content-center">
<div class="btn btn-danger btn-lg rounded-circle d-flex align-items-center justify-content-center"
style="width: 60px; height: 60px;">
<i class="bi bi-play-btn" style="font-size: 2rem;"></i>
</div>
</div>
{# Overlay oscuro al hover #}
<div class="position-absolute top-0 start-0 w-100 h-100 bg-dark opacity-0 hover-overlay"
style="transition: opacity 0.3s ease;">
</div>
{# Título del vídeo #}
<div class="position-absolute bottom-0 start-0 end-0 bg-dark bg-opacity-75 text-white p-3 rounded">
<h6 class="mb-0 text-white">{{ video.titulo }}</h6>
</div>
{# Thumbnail clickeable en lugar del iframe #}
<div class="ratio ratio-16x9 video-thumbnail-container position-relative rounded"
data-bs-toggle="modal"
data-bs-target="#videoModal"
data-video-url="{{ video_data.embed_url }}"
data-video-title="{{ video.titulo }}"
data-video-allow="{{ video_data.allow }}"
style="cursor: pointer;
background-image: url('{{ video_data.thumbnail_url }}');
background-size: cover;
background-position: center;">
{# Overlay con botón play #}
<div class="position-absolute top-0 start-0 w-100 h-100 d-flex align-items-center justify-content-center">
<div class="btn btn-danger btn-lg rounded-circle d-flex align-items-center justify-content-center"
style="width: 60px; height: 60px;">
<i class="bi bi-play-btn" style="font-size: 2rem;"></i>
</div>
{% else %}
<div class="alert alert-warning">
<h5>{{ video.titulo }}</h5>
<p class="mb-0">No se ha configurado URL para este vídeo.</p>
</div>
{% endif %}
</div>
{# Overlay oscuro al hover #}
<div class="position-absolute top-0 start-0 w-100 h-100 bg-dark opacity-0 hover-overlay"
style="transition: opacity 0.3s ease;">
</div>
{# Título del vídeo #}
<div class="position-absolute bottom-0 start-0 end-0 bg-dark bg-opacity-75 text-white p-3 rounded">
<h6 class="mb-0 text-white">{{ video.titulo }}</h6>
</div>
</div>
{% endif %}
{% endfor %}
{% else %}
<div class="alert alert-warning">
<h5>{{ video.titulo }}</h5>
<p class="mb-0">{{ __('No hay URL', 'Sindikatua') }}</p>
</div>
{% endif %}
</div>
</div>
{% endif %}
{% endfor %}
</div>
{# carousel controls buttons#}
{% if videos|length > 1 %}
<button class="carousel-control-prev" type="button" data-bs-target="#videosCarousel" data-bs-slide="prev">
<span class="carousel-control-prev-icon" aria-hidden="true"></span>
<span class="visually-hidden">Anterior</span>
</button>
<button class="carousel-control-next" type="button" data-bs-target="#videosCarousel" data-bs-slide="next">
<span class="carousel-control-next-icon" aria-hidden="true"></span>
<span class="visually-hidden">Siguiente</span>
</button>
{# <div class="carousel-indicators">
{% for pair in videos|batch(2, null) %}
<button type="button" data-bs-target="#videosCarousel" data-bs-slide-to="{{ loop.index0 }}"
{% if loop.first %}class="active"{% endif %} aria-label="Slide {{ loop.index }}"></button>
{% endfor %}
</div> #}
{% endif %}
</div>
{% endfor %}
</div>
{% else %}
<p>No hay vídeos disponibles.</p>
{# carousel controls buttons#}
{% if videos|length > 1 %}
<button class="carousel-control-prev" type="button" data-bs-target="#videosCarousel" data-bs-slide="prev">
<span class="carousel-control-prev-icon" aria-hidden="true"></span>
<span class="visually-hidden">Anterior</span>
</button>
<button class="carousel-control-next" type="button" data-bs-target="#videosCarousel" data-bs-slide="next">
<span class="carousel-control-next-icon" aria-hidden="true"></span>
<span class="visually-hidden">Siguiente</span>
</button>
{# <div class="carousel-indicators">
{% for pair in videos|batch(2, null) %}
<button type="button" data-bs-target="#videosCarousel" data-bs-slide-to="{{ loop.index0 }}"
{% if loop.first %}class="active"{% endif %} aria-label="Slide {{ loop.index }}"></button>
{% endfor %}
</div> #}
{% endif %}
</div>
{# MODAL PARA REPRODUCIR VÍDEO #}
<div class="modal fade" id="videoModal" tabindex="-1" aria-labelledby="videoModalLabel" aria-hidden="true">
<div class="modal-dialog modal-lg modal-dialog-centered">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title" id="videoModalLabel"></h5>
<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Cerrar"></button>
</div>
<div class="modal-body p-0">
<div class="ratio ratio-16x9">
<iframe id="modalVideoIframe"
src=""
title=""
frameborder="0"
allow=""
allowfullscreen
loading="lazy">
</iframe>
</div>
</div>
{% endif %}
</div>
{# MODAL PARA REPRODUCIR VÍDEO #}
<div class="modal fade" id="videoModal" tabindex="-1" aria-labelledby="videoModalLabel" aria-hidden="true">
<div class="modal-dialog modal-lg modal-dialog-centered">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title" id="videoModalLabel"></h5>
<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Cerrar"></button>
</div>
<div class="modal-body p-0">
<div class="ratio ratio-16x9">
<iframe id="modalVideoIframe"
src=""
title=""
frameborder="0"
allow=""
allowfullscreen
loading="lazy">
</iframe>
</div>
</div>
</div>
{# Segunda columna - Último artículo de opinión #}
<div class="col-lg-4 col-12 opinion-article d-flex flex-column">
<p class="mb-4 position-relative fs-4 fw-bold sp-module-title">OPINIÓN</p>
<div class="flex-grow-1 d-flex">
{% if ultimo_articulo_opinion %}
{% for article in ultimo_articulo_opinion %}
<div class="card w-100 h-100 secondary-article">
<a class="h-100" href="{{ article.link }}">
<img src="{{ article.thumbnail.src('medium') }}"
alt="{{ article.thumbnail.alt }}"
class="card-img h-100 object-fit-cover"/>
<div class="card-img-overlay d-flex flex-column justify-content-end align-items-start">
<div>
<!-- Título -->
<p class="card-title text-wrap fs-6">
<a href="{{ article.link }}" class="text-white text-decoration-none">{{ article.title }}</a>
</p>
<!-- Icono + autor -->
<p class="text-white mb-0 fs-7 d-flex align-items-center">
<i class="bi bi-person me-1"></i>
{{ article.author }}
</p>
</div>
</div>
</a>
</div>
{% endfor %}
{% else %}
<p class="text-muted">No hay artículos de opinión disponibles.</p>
{% endif %}
</div>
</div>
</div>
</div>
</section>
{# Segunda columna - Último artículo de opinión #}
<div class="col-lg-4 col-12 opinion-article d-flex flex-column">
<h1 class="mb-4 position-relative fs-4 fw-bold sp-module-title">{{ __('Opinión', 'Sindikatua')|upper}}</h1>
<div class="flex-grow-1 d-flex">
{% if ultimo_articulo_opinion and ultimo_articulo_opinion|length > 0 %}
{% for article in ultimo_articulo_opinion %}
<div class="card w-100 h-100 secondary-article">
<a class="h-100" href="{{ article.link }}">
<img src="{{ article.thumbnail.src('medium') }}"
alt="{{ article.thumbnail.alt }}"
class="card-img h-100 object-fit-cover"/>
<div class="card-img-overlay d-flex flex-column justify-content-end align-items-start">
<div>
<!-- Título -->
<p class="card-title text-wrap fs-6">
<a href="{{ article.link }}" class="text-white text-decoration-none">{{ article.title }}</a>
</p>
<!-- Icono + autor -->
<p class="text-white mb-0 fs-7 d-flex align-items-center">
<i class="bi bi-person me-1"></i>
{{ article.author }}
</p>
</div>
</div>
</a>
</div>
{% endfor %}
{% else %}
<p>{{ __('No hay artículos', 'Sindikatua') }}</p>
{% endif %}
</div>
</div>
</div>

View File

@ -6,7 +6,7 @@
{{
post.excerpt({
words: 5,
read_more: 'Keep reading'
read_more: 'Sigue leyendo'
})
}}
</p>

View File

@ -1,9 +1,30 @@
<article class="tease tease-{{ post.type }}" id="tease-{{ post.id }}">
{% block content %}
<h2 class="h2"><a href="{{ post.link }}">{{ post.title }}</a></h2>
<p>{{ post.excerpt }}</p>
{% if post.thumbnail %}
<img src="{{ post.thumbnail.src }}" />
{% endif %}
{% endblock %}
<article class="tease tease-{{ post.type }} border border-black rounded my-3 p-2 position-relative"
id="tease-{{ post.id }}"
style="padding-bottom: 65px !important;">
<div class="row align-items-center section-tease">
<!-- Columna izquierda: título y excerpt -->
<div class="col">
<h2 class="h2">
<a href="{{ post.link }}"
class="text-decoration-none text-dark link-underline-animate">
{{ post.title }}</a>
</h2>
<p>{{ post.excerpt({
words: 50,
read_more: ''
})
}}</p>
<a href="{{ post.link }}"
class="btn position-absolute btn-secondary-cnt"
style="position: absolute; bottom: 15px; right: 15px; z-index: 10;"
>Sigue leyendo...</a>
</div>
<!-- Columna derecha: imagen (si existe) -->
{% if post.thumbnail %}
<div class="col-auto text-end">
<img src="{{ post.thumbnail.src }}" style="max-height: 100px;" alt="{{ post.title }}" class="img-fluid ms-auto d-block" />
</div>
{% endif %}
</div>
</article>

View File

@ -1,22 +1,43 @@
<div class="container">
<div class="row align-items-center py-1">
<!-- Izquierda: Botones -->
<div class="col">
{% if languages %}
<div class="btn-bar d-flex align-items-center">
<button class="btn btn-outline-dark btn-sm me-2">
<span class="d-inline d-sm-none">EUS</span>
<span class="d-none d-sm-inline">EUSKERA</span>
</button>
<button class="btn btn-outline-dark btn-sm">
<span class="d-inline d-sm-none">CAS</span>
<span class="d-none d-sm-inline">CASTELLANO</span>
</button>
{% for lang in languages %}
{% if lang.slug == 'es' or lang.slug == 'cas' %}
{# Botón Castellano #}
<a href="{{ lang.url }}"
class="btn {{ lang.current ? 'btn-dark' : 'btn-outline-dark' }} btn-sm ms-2"
{% if lang.current %}aria-current="page"{% endif %}>
<span class="d-inline d-sm-none">CAS</span>
<span class="d-none d-sm-inline">CASTELLANO</span>
</a>
{% elseif lang.slug == 'eu' or lang.slug == 'eus' %}
{# Botón Euskera #}
<a href="{{ lang.url }}"
class="btn {{ lang.current ? 'btn-dark' : 'btn-outline-dark' }} btn-sm ms-2"
{% if lang.current %}aria-current="page"{% endif %}>
<span class="d-inline d-sm-none">EUS</span>
<span class="d-none d-sm-inline">EUSKARA</span>
</a>
{% endif %}
{% endfor %}
</div>
{% else %}
<div style="background: #ffeeee; padding: 10px; border: 1px solid red;">
❌ No se encontraron idiomas
</div>
{% endif %}
</div>
<!-- Right side: RRSS -->
<div class="col d-flex justify-content-end">
{% include "partials/btn-search.twig" with {'items': menu.get_items} %}
<div class="btn-group m-1" role="group" aria-label="First group">
{% for red in redes_sociales %}
<a href="{{ red.url }}" class="btn btn-outline-dark btn-sm pt-0" target="_blank" rel="noopener noreferrer">
@ -31,4 +52,5 @@
</div>
</div>
</div>

View File

@ -2,8 +2,8 @@
{% block content %}
<main class="container py-5 text-center">
<h1 class="display-4">404 - Página no encontrada</h1>
<h1 class="display-4">404 - {{ __('Página no encontrada', 'Sindikatua') }}</h1>
<p class="lead">Ez da aurkitu bilatzen duzun orria / No se ha encontrado la página que buscabas</p>
<a href="<?php echo home_url(); ?>" class="btn btn-primary mt-4">Volver al inicio</a>
<a href="<?php echo home_url(); ?>" class="btn btn-primary mt-4">{{ __('Volver al inicio', 'Sindikatua') }}</a>
</main>
{% endblock %}

View File

@ -0,0 +1 @@
{% extends 'templates/page-quieres-afiliarte.twig' %}

View File

@ -0,0 +1 @@
{% extends 'templates/page-noticias.twig' %}

View File

@ -0,0 +1 @@
{% extends 'templates/page-videos.twig' %}

View File

@ -0,0 +1 @@
{% extends 'templates/single-acerca.twig' %}

View File

@ -1,13 +1,9 @@
{% extends 'layouts/base.twig' %}
{% block content %}
<!-- <p class="alert alert-info" role="alert">
<i class="bi bi-envelope-at"></i>
PLANTILLA CONTACTOS</p> -->
<section class="contacto-barakaldo">
<section class="contacto">
<div class="container my-5">
<!-- mapa & contacts -->
<div class="row">
<!-- Column map -->
@ -28,7 +24,8 @@
<small>
<a href="https://www.openstreetmap.org/?#map=19/{{ latitud }}/{{ longitud }}">
Ver el mapa más grande
{{ __('Ver el mapa más grande', 'Sindikatua') }}
</a>
</small>
{% endif %}
@ -37,7 +34,7 @@
<!-- Column content -->
<div class="col-md-6">
<div class="content">
<h2>{{ contacto_info.nombre }}</h2>
<h1>{{ contacto_info.nombre }}</h1>
<p>{{ contacto_info.direccion }}</p>
<p>{{ contacto_info.forma_contacto }}</p>
@ -63,7 +60,8 @@
<!-- form -->
<div class="row mt-5">
<div class="col-12">
<p class="mb-4 position-relative fs-4 fw-bold sp-module-title">Contacto</p>
<h2 class="mb-4 position-relative fs-4 fw-bold sp-module-title">{{ __('Contacto', 'Sindikatua')|upper }}</h2>
<div class="formulario-contacto">
<div class="container">
<div class="row justify-content-center">

View File

@ -1,7 +1,7 @@
{% extends 'layouts/base.twig' %}
{% block content %}
<p class="mb-5 position-relative fs-4 fw-bold sp-module-title">DOCUMENTOS</p>
<h1 class="mb-5 position-relative fs-4 fw-bold sp-module-title">{{ post.title }}</h1>
<section class="documentos">
<div class="container">
@ -41,13 +41,13 @@
class="btn btn-sm me-2 btn-primary-cnt"
target="_blank">
<i class="bi bi-eye-fill"></i>
Ver documento
{{ __('Ver documento', 'Sindikatua') }}
</a>
<a href="{{ doc.documento_url }}" download
class="btn btn-sm me-2 btn-primary-cnt" >
<i class="bi bi-cloud-download-fill"></i>
Descargar
{{ __('Descargar', 'Sindikatua') }}
</a>
{% endif %}

View File

@ -0,0 +1 @@
{% extends 'templates/page-documentos.twig' %}

View File

@ -1,50 +1,50 @@
{% extends 'layouts/base.twig' %}
{% block content %}
<p class="mb-5 position-relative fs-4 fw-bold sp-module-title">ENLACES</p>
<h1 class="mb-5 position-relative fs-4 fw-bold sp-module-title">{{ post.title }}</h1>
{% if enlaces %}
<div class="enlaces">
<div class="accordion" id="accordionEnlaces">
{% for grupo in enlaces %}
<div class="accordion-item">
<h2 class="accordion-header">
<div class="accordion" id="accordionEnlaces">
{% for grupo in enlaces %}
<div class="accordion-item">
<h2 class="accordion-header">
<button class="accordion-button {% if loop.index0 != 0 %}collapsed{% endif %}"
type="button"
data-bs-toggle="collapse"
data-bs-target="#collapse{{ loop.index }}"
aria-expanded="{% if loop.index0 == 0 %}true{% else %}false{% endif %}"
aria-controls="collapse{{ loop.index }}">
{{ grupo.titulo }}
<button class="accordion-button {% if loop.index0 != 0 %}collapsed{% endif %}"
type="button"
data-bs-toggle="collapse"
data-bs-target="#collapse{{ loop.index }}"
aria-expanded="{% if loop.index0 == 0 %}true{% else %}false{% endif %}"
aria-controls="collapse{{ loop.index }}">
{{ grupo.titulo }}
<span class="badge bg-secondary ms-2">{{ grupo.enlaces|length }}</span>
</button>
</h2>
<div id="collapse{{ loop.index }}"
class="accordion-collapse collapse {% if loop.index0 == 0 %}show{% endif %}"
data-bs-parent="#accordionEnlaces">
<div class="accordion-body">
{% if grupo.enlaces %}
<div class="d-grid gap-2">
{% for enlace in grupo.enlaces %}
<a href="{{ enlace.url }}"
class="btn btn-outline-dark btn-sm text-start"
target == '_blank'
rel="noopener noreferrer">
{{ enlace.titulo }}
{% if enlace.target == '_blank' %}
<i class="fas fa-external-link-alt ms-1 small"></i>
{% endif %}
</a>
{% endfor %}
</div>
{% endif %}
<span class="badge bg-secondary ms-2">{{ grupo.enlaces|length }}</span>
</button>
</h2>
<div id="collapse{{ loop.index }}"
class="accordion-collapse collapse {% if loop.index0 == 0 %}show{% endif %}"
data-bs-parent="#accordionEnlaces">
<div class="accordion-body">
{% if grupo.enlaces %}
<div class="d-grid gap-2">
{% for enlace in grupo.enlaces %}
<a href="{{ enlace.url }}"
class="btn btn-outline-dark btn-sm text-start"
target == '_blank'
rel="noopener noreferrer">
{{ enlace.titulo }}
{% if enlace.target == '_blank' %}
<i class="fas fa-external-link-alt ms-1 small"></i>
{% endif %}
</a>
{% endfor %}
</div>
{% endif %}
</div>
</div>
</div>
</div>
{% endfor %}
</div>
{% endfor %}
</div>
</div>
{% endif %}

View File

@ -0,0 +1 @@
{% extends 'templates/page-portada.twig' %}

View File

@ -1,7 +1,7 @@
{% extends 'layouts/base.twig' %}
{% block content %}
<p class="mb-5 position-relative fs-4 fw-bold sp-module-title">INDUSTRIA</p>
<h1 class="mb-5 position-relative fs-4 fw-bold sp-module-title">{{ post.title }}</h1>
{% endblock %}

View File

@ -0,0 +1 @@
{% extends 'templates/page-enlaces.twig' %}

View File

@ -1,38 +1,45 @@
{% extends 'layouts/base.twig' %}
{% block content %}
<p class="mb-5 position-relative fs-4 fw-bold sp-module-title">NOTICIAS</p>
<h1 class="mb-5 position-relative fs-3 fw-bold sp-module-title">{{ post.title }}</h1>
<section class="posts-noticias">
{% if recent_posts_noticias %}
{% for noticias in recent_posts_noticias %}
<div class="card my-3 position-relative">
<div class="row g-0">
<div class="col-md-4">
<img src="{{ noticias.thumbnail.src }}"
class="rounded-start object-fit-cover w-100 h-100"
alt="{{ noticias.thumbnail.alt }}"
style="min-height: 200px;"
/>
<div class="row g-0">
<div class="col-md-4">
<a href="{{ noticias.link }}" title="{{ noticias.title }}">
<img src="{{ noticias.thumbnail.src }}"
class="rounded-start object-fit-cover w-100 h-100 img-noticias"
alt="{{ noticias.thumbnail.alt }}"
style="min-height: 200px;"
/>
</a>
</div>
<div class="col-md-8">
<div class="card-body" style="padding-bottom: 60px;">
<a href="{{ noticias.link }}" title="{{ noticias.title }}" class="text-decoration-none card-title">
<h5 class="card-title-text">{{ noticias.title }}</h5>
</a>
<p class="card-text"> {{
noticias.excerpt({
words: 50,
read_more: ''
})
}}</p>
<p class="card-text"><small class="text-body-secondary">{{ noticias.date }}</small></p>
<a href="{{ noticias.link }}"
class="btn position-absolute btn-secondary-cnt"
style="position: absolute; bottom: 15px; right: 15px; z-index: 10;"
>
{{ __('Sigue leyendo', 'Sindikatua') }}...
</a>
</div>
</div>
</div>
<div class="col-md-8">
<div class="card-body" style="padding-bottom: 60px;">
<h5 class="card-title">{{ noticias.title }}</h5>
<p class="card-text"> {{
noticias.excerpt({
words: 50,
read_more: ''
})
}}</p>
<p class="card-text"><small class="text-body-secondary">{{ noticias.date }}</small></p>
<a href="{{ noticias.link }}"
class="btn position-absolute btn-secondary-cnt"
style="position: absolute; bottom: 15px; right: 15px; z-index: 10;"
>Sigue leyendo...</a>
</div>
</div>
</div>
</div>
{% endfor %}

View File

@ -4,120 +4,116 @@
{# Sección noticias #}
{% if recent_posts_noticias %}
<section class="recent-posts">
<div class="row g-4 mt-3">
{# Columna izquierda - Artículo principal #}
<div class="col-md-8">
{% set main_article = recent_posts_noticias[0] %}
<div class="card main-article">
<a href="{{ main_article.link }}">
<img src="{{ main_article.thumbnail.src('medium') }}"
alt="{{ main_article.thumbnail.alt }}"
class="card-img " />
<div class="card-img-overlay">
<h3 class="card-title text-wrap">
<a href="{{ main_article.link }}">{{ main_article.title }}</a>
</h3>
<section class="recent-posts">
<div class="row g-4 mt-3">
{# Columna izquierda - Artículo principal #}
<div class="col-md-8">
{% set main_article = recent_posts_noticias[0] %}
<div class="card main-article">
<a href="{{ main_article.link }}">
<img src="{{ main_article.thumbnail.src('medium') }}"
alt="{{ main_article.thumbnail.alt }}"
class="card-img img-noticias" />
<div class="card-img-overlay">
<h3 class="card-title text-wrap">
<a href="{{ main_article.link }}">{{ main_article.title }}</a>
</h3>
</div>
</div>
</div>
</div>
{# Columna derecha - Dos artículos secundarios #}
<div class="col-md-4">
<div class="d-flex flex-column h-100 justify-content-between">
{% for article in recent_posts_noticias[1:3] %}
<div class="card secondary-article {% if loop.first %}media-mb{% endif %}">
<a href="{{ article.link }}">
<img src="{{ article.thumbnail.src('medium') }}"
alt="{{ article.thumbnail.alt }}"
class="card-img "/>
<div class="card-img-overlay">
<h3 class="card-title text-wrap">
<a href="{{ article.link }}">{{ article.title }}</a>
</h3>
{# Columna derecha - Dos artículos secundarios #}
<div class="col-md-4">
<div class="d-flex flex-column h-100 justify-content-between">
{% for article in recent_posts_noticias[1:3] %}
<div class="card secondary-article {% if loop.first %}media-mb{% endif %}">
<a href="{{ article.link }}">
<img src="{{ article.thumbnail.src('medium') }}"
alt="{{ article.thumbnail.alt }}"
class="card-img img-noticias"/>
<div class="card-img-overlay">
<h3 class="card-title text-wrap">
<a href="{{ article.link }}">{{ article.title }}</a>
</h3>
</div>
</div>
</div>
{% endfor %}
{% endfor %}
</div>
</div>
</div>
</div>
</section>
{% else %}
<h2>no hay artículos</h2>
{% endif %}
{# Sección Logos #}
{% if botones_imagen %}
<section class="custom-buttons-section my-5">
<p class="mb-4 position-relative fs-4 fw-bold sp-module-title">ENLACES</p>
<div class="row g-3">
{% for boton in botones_imagen %}
<div class="col-md-3 col-sm-6">
<a href="{{ boton.enlace }}" class="btn-image-only d-block" target="_blank" rel="noopener noreferrer">
<img src="{{ boton.imagen.sizes.medium }}"
alt="{{ boton.imagen.alt }}"
class="img-fluid rounded">
</a>
</div>
{% endfor %}
</div>
</section>
{% endif %}
{# Sección vídeos #}
{% include 'partials/section-videos.twig' %}
{# Sección Enlaces #}
<section class="custom-buttons-section margin-50">
<h1 class="mb-4 position-relative fs-4 fw-bold sp-module-title">{{ __('Enlaces', 'Sindikatua')|upper }}</h1>
{# Sección Campañas / conlfictos #}
<div class="row g-3">
{% if botones_imagen %}
{% for boton in botones_imagen %}
<div class="col-6 col-sm-6 col-md-3 btn-hover">
<a href="{{ boton.enlace }}" class="btn-image-only d-block" target="_blank" rel="noopener noreferrer">
<img src="{{ boton.imagen.sizes.medium }}"
alt="{{ boton.imagen.alt }}"
class="img-fluid rounded">
</a>
</div>
{% endfor %}
{% endif %}
</div>
</section>
{# Sección vídeos + Opinión #}
<section class="py-4 margin-50">
{% include 'partials/section-videos.twig' %}
</section>
{# Sección Campañas / conflictos #}
<section class="recent-posts py-4">
<div class="container">
<div class="row align-items-stretch">
{% if posts_campana %}
<div class="col-6">
<p class="mb-4 position-relative fs-4 fw-bold sp-module-title">CAMPAÑAS</p>
<h1 class="mb-4 position-relative fs-4 fw-bold sp-module-title">{{ __('Campañas', 'Sindikatua')|upper }}</h1>
{% set main_article = posts_campana[0] %}
<div class="card main-article">
<a href="{{ main_article.link }}">
<img src="{{ main_article.thumbnail.src('medium') }}"
alt="{{ main_article.thumbnail.alt }}"
class="card-img card-img-fixed" />
<div class="card-img-overlay">
<h3 class="card-title text-wrap">
<a href="{{ main_article.link }}">{{ main_article.title }}</a>
</h3>
{% if posts_campana and posts_campana|length > 0 %}
{% set main_article = posts_campana[0] %}
<div class="card main-article">
<a href="{{ main_article.link }}">
<img src="{{ main_article.thumbnail.src('medium') }}"
alt="{{ main_article.thumbnail.alt }}"
class="card-img card-img-fixed img-noticias" />
<div class="card-img-overlay">
<h3 class="card-title text-wrap">
<a href="{{ main_article.link }}">{{ main_article.title }}</a>
</h3>
</div>
</div>
</div>
{% else %}
<p>{{ __('No hay artículos', 'Sindikatua') }}</p>
{% endif %}
</div>
{% else %}
<h2>no hay artículos</h2>
{% endif %}
{% if posts_campana %}
<div class="col-6">
<p class="mb-4 position-relative fs-4 fw-bold sp-module-title">CONFLICTOS LABORALES</p>
<h1 class="mb-4 position-relative fs-4 fw-bold sp-module-title">{{ __('Conflictos Laborales', 'Sindikatua')|upper }}</h1>
{% set main_article = posts_campana[0] %}
<div class="card main-article">
<a href="{{ main_article.link }}">
<img src="{{ main_article.thumbnail.src('medium') }}"
alt="{{ main_article.thumbnail.alt }}"
class="card-img card-img-fixed" />
<div class="card-img-overlay">
<h3 class="card-title text-wrap">
<a href="{{ main_article.link }}">{{ main_article.title }}</a>
</h3>
{% if posts_campana and posts_campana|length > 0 %}
{% set main_article = posts_campana[0] %}
<div class="card main-article">
<a href="{{ main_article.link }}">
<img src="{{ main_article.thumbnail.src('medium') }}"
alt="{{ main_article.thumbnail.alt }}"
class="card-img card-img-fixed img-noticias" />
<div class="card-img-overlay">
<h3 class="card-title text-wrap">
<a href="{{ main_article.link }}">{{ main_article.title }}</a>
</h3>
</div>
</div>
</div>
{% else %}
<p>{{ __('No hay artículos', 'Sindikatua') }}</p>
{% endif %}
</div>
{% else %}
<h2>no hay artículos</h2>
{% endif %}
</div>
</div>
</section>

View File

@ -1,43 +1,15 @@
{% extends 'layouts/base.twig' %}
{% block content %}
<p class="mb-5 position-relative fs-4 fw-bold sp-module-title">AFÍLIATE</p>
<div class="affiliate-section">
<div class="container">
<div class="row align-items-center p-5">
<!-- Primera columna - Imagen -->
<div class="col-md-6">
{% if afiliate_fields.imagen_afiliate %}
<div class="affiliate-image">
<img src="{{ afiliate_fields.imagen_afiliate }}"
class="img-fluid rounded">
</div>
{% endif %}
</div>
<!-- Segunda columna - Contenido y botón -->
<div class="col-md-6">
<div class="affiliate-content">
<!-- Contenido de la página -->
<div class="page-content">
{{ post.content }}
</div>
<!-- Botón de afiliado -->
{% if afiliate_fields.enlace_boton_afiliate %}
<div class="affiliate-button-container mt-4">
<a href="{{ afiliate_fields.enlace_boton_afiliate }}"
class="btn btn-lg btn-primary-cnt"
target="_blank"
rel="noopener noreferrer">
{{ afiliate_fields.texto_boton }}
</a>
</div>
{% endif %}
</div>
<h1 class="mb-5 position-relative fs-4 fw-bold sp-module-title">{{ post.title }}</h1>
<div class="affiliate-section">
<div class="container">
<div class="page-content">
{{ post.content }}
</div>
</div>
</div>
</div>
{% endblock %}

View File

@ -3,7 +3,7 @@
{% block content %}
<p class="mb-5 position-relative fs-4 fw-bold sp-module-title">SERVICIOS PRIVADOS</p>
<section class="grid servicios-privados">
<section class="grid servicios servicios-privados">
<div class="container">
<div class="row">
{% for pagina in subpaginas_servicios_privados %}
@ -18,8 +18,11 @@
<p>no hay thumbnail </p>
{% endif %}
<div class="card-body">
<h5 class="card-title">{{ pagina.title }}</h5>
<a href="{{ pagina.link }}" class="text-decoration-none">
<h5 href="{{ pagina.link }}" class="card-title">{{ pagina.title }}</h5>
</a>
<p class="card-text">{{ pagina.content }}</p>
</div>
</div>
</article>

View File

@ -3,7 +3,7 @@
{% block content %}
<p class="mb-5 position-relative fs-4 fw-bold sp-module-title">SERVICIOS PÚBLICOS</p>
<section class="grid servicios-publicos">
<section class="grid servicios servicios-publicos">
<div class="container">
<div class="row">
{% for pagina in subpaginas_servicios_publicos %}
@ -18,7 +18,9 @@
<p>no hay thumbnail </p>
{% endif %}
<div class="card-body">
<h5 class="card-title">{{ pagina.title }}</h5>
<a href="{{ pagina.link }}" class="text-decoration-none">
<h5 href="{{ pagina.link }}" class="card-title fs-4 text-dark link-underline-animate">{{ pagina.title }}</h5>
</a>
<p class="card-text">{{ pagina.content }}</p>
</div>
</div>

View File

@ -1,64 +1,61 @@
{% extends 'layouts/base.twig' %}
{% block content %}
<p class="mb-5 position-relative fs-4 fw-bold sp-module-title">VÍDEOS</p>
<h1 class="mb-5 position-relative fs-4 fw-bold sp-module-title">{{ post.title }}</h1>
<div class="container text-center">
<div class="row">
{% if videos %}
{% for video in videos %}
<div class="col-xl-3 col-lg-4 col-md-6 col-sm-12 mb-2">
<div class="video-item">
{% set url_video = video.meta('url_video') %}
{% set video_data = generar_embed(url_video) %}
{% if video_data %}
{% if videos %}
{% for video in videos %}
<div class="col-xl-3 col-lg-4 col-md-6 col-sm-12 mb-2">
<div class="video-item">
{% set url_video = video.meta('url_video') %}
{% set video_data = generar_embed(url_video) %}
{% if video_data %}
{# Thumbnail clickeable en lugar del iframe #}
<div class="ratio ratio-16x9 video-thumbnail-container position-relative rounded"
data-bs-toggle="modal"
data-bs-target="#videoModal"
data-video-url="{{ video_data.embed_url }}"
data-video-title="{{ video.titulo }}"
data-video-allow="{{ video_data.allow }}"
style="cursor: pointer;
background-image: url('{{ video_data.thumbnail_url }}');
background-size: cover;
background-position: center;">
{# Thumbnail clickeable en lugar del iframe #}
<div class="ratio ratio-16x9 video-thumbnail-container position-relative rounded"
data-bs-toggle="modal"
data-bs-target="#videoModal"
data-video-url="{{ video_data.embed_url }}"
data-video-title="{{ video.titulo }}"
data-video-allow="{{ video_data.allow }}"
style="cursor: pointer;
background-image: url('{{ video_data.thumbnail_url }}');
background-size: cover;
background-position: center;">
{# Overlay con botón play #}
<div class="position-absolute top-0 start-0 w-100 h-100 d-flex align-items-center justify-content-center">
<div class="btn btn-danger btn-lg rounded-circle d-flex align-items-center justify-content-center"
style="width: 60px; height: 60px;">
<i class="bi bi-play-btn" style="font-size: 2rem;"></i>
{# Overlay con botón play #}
<div class="position-absolute top-0 start-0 w-100 h-100 d-flex align-items-center justify-content-center">
<div class="btn btn-danger btn-lg rounded-circle d-flex align-items-center justify-content-center"
style="width: 60px; height: 60px;">
<i class="bi bi-play-btn" style="font-size: 2rem;"></i>
</div>
</div>
{# Overlay oscuro al hover #}
<div class="position-absolute top-0 start-0 w-100 h-100 bg-dark opacity-0 hover-overlay"
style="transition: opacity 0.3s ease;">
</div>
{# Título del vídeo #}
<div class="position-absolute bottom-0 start-0 end-0 bg-dark bg-opacity-75 text-white p-3 rounded">
<h6 class="mb-0 text-white">{{ video.titulo }}</h6>
</div>
</div>
{# Overlay oscuro al hover #}
<div class="position-absolute top-0 start-0 w-100 h-100 bg-dark opacity-0 hover-overlay"
style="transition: opacity 0.3s ease;">
</div>
{# Título del vídeo #}
<div class="position-absolute bottom-0 start-0 end-0 bg-dark bg-opacity-75 text-white p-3 rounded">
<h6 class="mb-0 text-white">{{ video.titulo }}</h6>
</div>
{% else %}
<div class="alert alert-warning">
<h5>{{ video.titulo }}</h5>
<p class="mb-0">No se ha configurado URL para este vídeo.</p>
</div>
{% endif %}
</div>
{% else %}
<div class="alert alert-warning">
<h5>{{ video.titulo }}</h5>
<p class="mb-0">No se ha configurado URL para este vídeo.</p>
</div>
{% endif %}
</div>
</div>
{% endfor %}
{% else %}
<p>No hay vídeos disponibles.</p>
{% endif %}
{% endfor %}
{% else %}
<p>No hay vídeos disponibles.</p>
{% endif %}
</div>
{# MODAL PARA REPRODUCIR VÍDEO #}
@ -87,5 +84,4 @@
</div>
{% endblock %}
{% endblock %}

View File

@ -0,0 +1 @@
{% extends 'templates/page-servicios-publicos.twig' %}

View File

@ -2,17 +2,23 @@
{% extends 'layouts/base.twig' %}
{% block content %}
<div class="content-wrapper">
{% for post in posts %}
{% include ['partials/tease-' ~ post.type ~ '.twig', 'partials/tease.twig'] %}
{% endfor %}
<section class="search-canvas ">
<p class="mb-5 position-relative fs-4 fw-bold sp-module-title">{{ post.title }}</p>
<p>{{ __('Resultados de búsqueda para', 'Sindikatua')}}: "{{ search_query }}"</p>
<div class="content-wrapper">
{% for post in posts %}
{% include ['partials/tease-' ~ post.type ~ '.twig', 'partials/tease.twig'] %}
{% endfor %}
{% include 'partials/pagination.twig' with {
pagination: posts.pagination({
show_all: false,
mid_size: 3,
end_size: 2
})
} %}
</div>
</section>
{% include 'partials/pagination.twig' with {
pagination: posts.pagination({
show_all: false,
mid_size: 3,
end_size: 2
})
} %}
</div>
{% endblock %}

View File

@ -1,7 +1,7 @@
{% extends 'layouts/base.twig' %}
{% block content %}
<p class="mb-5 position-relative fs-4 fw-bold sp-module-title">ACERCA DE LA CNT</p>
<p class="mb-5 position-relative fs-4 fw-bold sp-module-title">{{ post.title }}</p>
<div class="container mt-4">
<div class="row">

View File

@ -0,0 +1,32 @@
{% extends 'layouts/base.twig' %}
{% block content %}
{# <p>Servicios test</p> #}
<div class="container">
<article class="post-type-{{ post.type }}" id="post-{{ post.id }}">
<section class="article-content mt-5 border-dark border-top">
<!-- Title & author & date -->
<h1 class="article-h1">{{ post.title }}</h1>
<p class="blog-author mt-3 mb-5 border-dark border-bottom">
<span>{{ __('Autor', 'Sindikatua')}}:</span>
<a href="{{ post.author.path }}">{{ post.author.name }}</a>
<span>&bull;</span>
<time datetime="{{ post.date|date('Y-m-d H:i:s') }}">{{ post.date }}</time>
</p>
<!-- Img & Content -->
<div class="d-flex justify-content-center my-5">
<img src="{{ post.thumbnail.src }}"
alt="{{ post.thumbnail.alt }}"
class="img-fluid object-fit-contain border border-1 rounded p-3"
style="max-width: 500px; max-height: 300px;"
/>
</div>
<div class="article-body">{{ post.content }}</div>
</section>
</article>
</div>
{% endblock %}

View File

@ -1,15 +1,17 @@
{% extends 'layouts/base.twig' %}
{% block content %}
{# <h1>SINGLE ARTÍCULOS</h1> #}
<div class="container">
<article class="post-type-{{ post.type }}" id="post-{{ post.id }}">
<!-- <img src="{{ post.thumbnail.src|resize(1200, 300) }}" /> -->
<!-- <img src="{{ post.thumbnail.src }}" /> -->
<section class="article-content mt-5 border-dark border-top">
<h1 class="article-h1">{{ post.title }}</h1>
<p class="blog-author mt-3 mb-5 border-dark border-bottom">
<span>Autor:</span>
<span>{{ __('Autor', 'Sindikatua')}}:</span>
<a href="{{ post.author.path }}">{{ post.author.name }}</a>
<span>&bull;</span>
<time datetime="{{ post.date|date('Y-m-d H:i:s') }}">{{ post.date }}</time>
@ -33,7 +35,7 @@
</div>
{% if post.comment_status == 'closed' %}
<p>No se puede comentar.</p>
<p>{{ __('No se puede comentar', 'Sindikatua') }}</p>
{% else %}
{% include 'partials/comment-form.twig' %}
{% endif %}