Style img posts & refactor

This commit is contained in:
2025-10-17 11:25:33 +00:00
parent 78ff00ff53
commit a198ea6eb3
6 changed files with 39 additions and 92 deletions

View File

@ -1,46 +1,33 @@
{% extends 'layouts/base.twig' %}
{% block content %}
<h1 class="mb-5 position-relative fs-4 fw-bold sp-module-title">{{ post.title }}</h1>
<h1 class="my-5 position-relative fs-3 fw-bold sp-module-title">{{ post.title }}</h1>
<!-- INDUSTRIA -->
<section class="posts-noticias">
<section class="section-industria">
{% if posts_industry %}
{% for noticias in posts_industry %}
{% set imagen = noticias.thumbnail.src | default('/wp-content/uploads/2025/10/Imagen_por_defecto.png') %}
{% set alt = noticias.thumbnail.alt | default('Imagen por defecto') %}
<div class="card my-3 position-relative">
<div class="card my-3 position-relative posts-noticias">
<div class="row g-0">
<div class="col-md-4">
<a href="{{ noticias.link }}" title="{{ noticias.title }}">
<img src="{{ imagen }}"
class="rounded-start object-fit-cover w-100 h-100 img-noticias"
alt="{{ alt }}"
style="min-height: 200px;"
/>
</a>
{# <a href="{{ noticias.link }}" title="{{ noticias.title }}"></a> #}
<img src="{{ imagen }}"
class="rounded-start object-fit-cover w-100 h-100 img-noticias"
alt="{{ alt }}"
style="min-height: 200px;"
/>
</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>
{# <a href="{{ noticias.link }}" title="{{ noticias.title }}" class="text-decoration-none card-title"></a> #}
<h5 class="card-title-text">{{ noticias.title }}</h5>
<p class="card-text"> {{noticias.content}}</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>
@ -48,7 +35,7 @@
{% endfor %}
{% else %}
<h2>no hay artículos</h2>
<p>{{ __('No hay artículos', 'Sindikatua') }}</p>
{% endif %}
<!-- PAGINATION -->

View File

@ -3,21 +3,20 @@
{% block content %}
<h1 class="my-5 position-relative fs-3 fw-bold sp-module-title">{{ post.title }}</h1>
<section class="posts-noticias">
<section class="section-noticias">
{% if posts_noticias %}
{% for noticias in posts_noticias %}
{% set imagen = noticias.thumbnail.src | default('/wp-content/uploads/2025/10/Imagen_por_defecto_300.jpg') %}
{% set alt = noticias.thumbnail.alt | default('Imagen por defecto') %}
<div class="card my-3 position-relative">
<div class="card my-3 position-relative posts-noticias">
<div class="row g-0">
<div class="col-md-4">
<a href="{{ noticias.link }}" title="{{ noticias.title }}">
<img src="{{ imagen }}"
class="rounded-start object-fit-cover w-100 h-100 img-noticias"
alt="{{ alt }}"
style="min-height: 200px;"
/>
</a>
</div>

View File

@ -3,14 +3,14 @@
{% block content %}
<h1 class="my-5 position-relative fs-3 fw-bold sp-module-title">{{ __('Opinión', 'Sindikatua') }}</h1>
<section class="posts-noticias">
<section class="section-opinion">
{% if posts_opinion %}
{% for noticias in posts_opinion %}
{% set imagen = noticias.thumbnail.src | default('/wp-content/uploads/2025/10/Imagen_por_defecto_300.jpg') %}
{% set alt = noticias.thumbnail.alt | default('Imagen por defecto') %}
<div class="card my-3 position-relative">
<div class="card my-3 position-relative posts-noticias">
<div class="row g-0">
<div class="col-md-4">
<a href="{{ noticias.link }}" title="{{ noticias.title }}">