News Hauteur paramétrable

This commit is contained in:
Fred Tempez 2021-04-01 18:00:49 +02:00
parent 7389f3026d
commit faf64a0660
4 changed files with 23 additions and 5 deletions

View File

@ -60,6 +60,12 @@ class news extends common {
];
public static $nbrCol = 1;
public static $ItemsHeight = [
'200px' => 'Petit',
'300px' => 'Moyen',
'400px' => 'Grand'
];
/**
* Mise à jour du module
@ -178,6 +184,7 @@ class news extends common {
'feedsLabel' => $this->getInput('newsConfigFeedslabel',helper::FILTER_STRING_SHORT),
'itemsperPage' => $this->getInput('newsConfigItemsperPage', helper::FILTER_INT,true),
'itemsperCol' => $this->getInput('newsConfigItemsperCol', helper::FILTER_INT,true),
'itemsHeight' => $this->getInput('newsConfigItemsHeight',helper::FILTER_STRING_SHORT),
'version' => $this->getData(['module', $this->getUrl(0), 'config', 'version'])
]]);
// Valeurs en sortie

View File

@ -39,19 +39,25 @@
</div>
<!-- Block ajouté pour le sélecteur -->
<div class="row">
<div class="col6">
<div class="col4">
<?php echo template::select('newsConfigItemsperCol', $module::$Columns, [
'label' => 'Pagination',
'selected' => $this->getData(['module', $this->getUrl(0),'config', 'itemsperCol']),
'help' => 'Nombre de colonnes par page'
]); ?>
</div>
<div class="col6">
<div class="col4">
<?php echo template::select('newsConfigItemsperPage', $module::$ItemsList, [
'label' => 'Articles par page',
'selected' => $this->getData(['module', $this->getUrl(0),'config', 'itemsperPage'])
]); ?>
</div>
<div class="col4">
<?php echo template::select('newsConfigItemsHeight', $module::$ItemsHeight, [
'label' => 'Hauteur',
'selected' => $this->getData(['module', $this->getUrl(0),'config', 'itemsHeight'])
]); ?>
</div>
</div>
</div>
</div>

View File

@ -21,6 +21,10 @@
background-color: #ECEFF1;
padding:5px;
}*/
.newsContent {
overflow: hidden; /* les dépassements seront masqués */
}
.newsContent {
clear: left;
@ -66,3 +70,4 @@
.col3 {width: 100%;}
.col4 {width: 100%;}
}

View File

@ -5,7 +5,7 @@
<h1 class="newsTitle" id="<?php echo $newsId;?>">
<?php echo $news['title']; ?>
</h1>
<div class="newsContent">
<div class="newsContent" style="height:<?php echo $this->getData(['module', $this->getUrl(0),'config', 'itemsHeight']); ?>;">
<?php echo $news['content']; ?>
</div>
<div class="newsSignature">