Blog Read More

This commit is contained in:
Fred Tempez 2023-03-24 08:48:30 +01:00
parent c85f208837
commit d4d88cfdeb
2 changed files with 31 additions and 12 deletions

View File

@ -50,6 +50,7 @@
margin-bottom: 5px;
}
.blogContent {
position: relative;
float: left;
margin-top: 5px;
}
@ -102,16 +103,28 @@
vertical-align: top;
}
article {
.rowArticle {
position: relative;
/* Autres styles pour les articles coupés */
}
article
.read-more-btn {
.readMoreContainer {
position: absolute;
bottom: 10px;
right: 10px;
z-index: 1;
bottom: 0px;
width: 100%;
height: 45%;
background: linear-gradient(180deg,hsla(0,0%,100%,0) 0,#f6f6f6 100%,#f6f6f6);
}
.readMoreButton {
position: absolute;
width: 20%;
bottom: 0px;
left: 0;
right: 0;
margin-left: auto;
margin-right: auto;
z-index: 99;
background: linear-gradient(180deg,hsla(0,0%,100%,0) 0,#f6f6f6 100%,#f6f6f6);
/* Autres styles pour le bouton */
}
}

View File

@ -144,14 +144,20 @@
<?php echo template::ico('calendar-empty'); ?>
<?php echo helper::dateUTF8($module::$dateFormat, $this->getData(['module', $this->getUrl(0), 'posts', $articleId, 'publishedOn'])) . ' - ' . helper::dateUTF8($module::$timeFormat, $this->getData(['module', $this->getUrl(0), 'posts', $articleId, 'publishedOn'])); ?>
</div>
<p class="blogContent">
<div class="blogContent">
<?php $lenght = $this->getData(['module', $this->getUrl(0), 'config', 'articlesLenght']) !== 0 ? $this->getData(['module', $this->getUrl(0), 'config', 'articlesLenght']) : 500 ?>
<?php echo helper::subword(strip_tags($article['content'], '<br><p>'), 0, $lenght); ?>...
<a href="<?php echo helper::baseUrl() . $this->getUrl(0) . '/' . $articleId; ?>"><button class="read-more-btn">Lire la suite</button></a>
</p>
<div class="readMoreContainer">
<a href="<?php echo helper::baseUrl() . $this->getUrl(0) . '/' . $articleId; ?>"><button class="readMoreButton">Lire la suite</button></a>
<div class="readMoreContainer">
<a href="<?php echo helper::baseUrl() . $this->getUrl(0) . '/' . $articleId; ?>">
<button class="readMoreButton">Lire la suite</button>
</a>
</div>
</div>
</div>
</div>
</div>
<?php endif; ?>
<?php endforeach; ?>
</article>