$category->setLabel('Catégorie de références');\r
$this->addElement($category);\r
\r
+ $elements = new CubeIT_Form_Element_Int('count');\r
+ $elements->setLabel('Nombre de références à afficher (multiple de 5)');\r
+ $elements->setValue(10);\r
+ $this->addElement($elements);\r
+\r
$exemples = new Fluidbook_Form_CMS_Element_Exemples('exemples');\r
$exemples->setLabel('Gestion des exemples');\r
$this->addElement($exemples);\r
/**\r
* @return string\r
*/\r
- public function exemples($category, $title) {\r
+ public function exemples($category, $title, $nb) {\r
$this->headScript()->addScriptAndStyle('220-exemples');\r
$this->headScript()->addMasonry();\r
\r
$exemples = Fluidbook_Model_Reference::factory()->order('date', 'DESC')->find();\r
\r
- $max_featured = 2;\r
+ $max_featured = floor($nb / 5);\r
$normal_per_featured = 4;\r
$max_normal = $max_featured * $normal_per_featured;\r
\r
<?php\r
echo $this->introBlock($this->intro, '');\r
-echo $this->exemples($this->category, $this->title);
\ No newline at end of file
+echo $this->exemples($this->category, $this->title,$this->count);
\ No newline at end of file
<?php\r
echo $this->introBlock($this->intro, '');\r
-echo $this->exemples($this->category, $this->title);\r
+echo $this->exemples($this->category, $this->title, $this->count);\r
echo $this->contactFooter();
\ No newline at end of file
&.featured {\r
color: #fff;\r
background-color: transparent;\r
- &:nth-of-type(odd) {\r
+ &:nth-of-type(11n+1) {\r
background: linear-gradient(45deg, rgba(249, 134, 126, 1) 0%, rgba(231, 92, 123, 1) 100%);\r
button{\r
.border-button-fill(#fff,rgba(231, 92, 123, 1));\r
}\r
}\r
- &:nth-child(7n+2) {\r
+ &:nth-child(11n+9) {\r
background: linear-gradient(45deg, #f5aa72 0%, #f6786e 100%);\r
button{\r
.border-button-fill(#fff,#f6786e);\r