Lire la suite WIP

This commit is contained in:
Fred Tempez 2023-03-23 07:56:45 +01:00
parent 65a12d0e25
commit c85f208837
3 changed files with 18 additions and 2 deletions

View File

@ -101,3 +101,17 @@
display: inline; display: inline;
vertical-align: top; vertical-align: top;
} }
article {
position: relative;
/* Autres styles pour les articles coupés */
}
article
.read-more-btn {
position: absolute;
bottom: 10px;
right: 10px;
z-index: 1;
/* Autres styles pour le bouton */
}

View File

@ -147,7 +147,8 @@
<p class="blogContent"> <p class="blogContent">
<?php $lenght = $this->getData(['module', $this->getUrl(0), 'config', 'articlesLenght']) !== 0 ? $this->getData(['module', $this->getUrl(0), 'config', 'articlesLenght']) : 500 ?> <?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); ?>... <?php echo helper::subword(strip_tags($article['content'], '<br><p>'), 0, $lenght); ?>...
<a href="<?php echo helper::baseUrl() . $this->getUrl(0) . '/' . $articleId; ?>">Lire la suite</a> <a href="<?php echo helper::baseUrl() . $this->getUrl(0) . '/' . $articleId; ?>"><button class="read-more-btn">Lire la suite</button></a>
</p> </p>
</div> </div>
</div> </div>

View File

@ -46,6 +46,7 @@
&& strlen($this->getData(['module', $this->getUrl(0), 'posts', $newsId, 'content'])) >= $this->getData(['module', $this->getUrl(0), 'config', 'height']) && strlen($this->getData(['module', $this->getUrl(0), 'posts', $newsId, 'content'])) >= $this->getData(['module', $this->getUrl(0), 'config', 'height'])
): ?> ): ?>
<?php echo ' ... <a href="' . helper::baseUrl(true) . $this->getUrl(0) . '/' . $newsId . '"><span class="newsSuite">lire la suite</span></a>'; ?> <?php echo ' ... <a href="' . helper::baseUrl(true) . $this->getUrl(0) . '/' . $newsId . '"><span class="newsSuite">lire la suite</span></a>'; ?>
<?php endif; ?> <?php endif; ?>
</div> </div>
</div> </div>