Bonjour,
J'ai un probleme de CSS ou de HTML, je ne sais pas trop...
J'ai en fait un objet catitembody, compose de catitemimage et catitemintrotext, et un objet catitemextrafields, qui s'affiche en dessous.
catitemimage catitemintrotext
catitemextrafields
Je souhaiterais que catitemextrafields soit inclu dans catitembody, pour obtenir les trois elements en ligne:
catitemimage catitemintrotext catitemextrafields
Voici le CSS actuel:
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17 div.catItemBody {display:inline; padding:8px 0;margin:0;} div.catItemImageBlock {float: left;width: 15%; margin: 9px;padding: 4px;} span.catItemImage {display:block;text-align:center;margin:0 0 8px 0;} span.catItemImage img {border:1px solid #ccc;padding:8px;} div.catItemIntroText {width:50%; px;font-size:inherit;font-weight:normal;line-height:inherit;padding:8px 12px;} div.catItemIntroText img {} div.catItemExtraFields, div.genericItemExtraFields {float: right;width:35%;margin:16px 0 0 0;padding:8px 0 0 0;border-top:1px dotted #ddd;} div.catItemExtraFields h4, div.genericItemExtraFields h4 {margin:0;padding:0 0 8px 0;line-height:normal !important;} div.catItemExtraFields ul, div.genericItemExtraFields ul {margin:0;padding:0;list-style:none;} div.catItemExtraFields ul li, div.genericItemExtraFields ul li {display:block;} div.catItemExtraFields ul li span.catItemExtraFieldsLabel, div.genericItemExtraFields ul li span.genericItemExtraFieldsLabel {display:block;float:left;font-weight:bold;margin:0 4px 0 0;width:40%;} div.catItemExtraFields ul li span.catItemExtraFieldsValue {}
Et le PHP actuel:
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44 <div class="catItemBody"> <!-- Plugins: BeforeDisplayContent --> <?php echo $this->item->event->BeforeDisplayContent; ?> <!-- K2 Plugins: K2BeforeDisplayContent --> <?php echo $this->item->event->K2BeforeDisplayContent; ?> <?php if($this->item->params->get('catItemImage') && !empty($this->item->image)): ?> <!-- Item Image --> <div class="catItemImageBlock"> <span class="catItemImage"> <a href="<?php echo $this->item->link; ?>" title="<?php if(!empty($this->item->image_caption)) echo $this->item->image_caption; else echo $this->item->title; ?>"> <img src="<?php echo $this->item->image; ?>" alt="<?php if(!empty($this->item->image_caption)) echo $this->item->image_caption; else echo $this->item->title; ?>" style="width:<?php echo $this->item->imageWidth; ?>px; height:auto;" /> </a> </span> </div> <?php endif; ?> <?php if($this->item->params->get('catItemIntroText')): ?> <!-- Item introtext --> <div class="catItemIntroText"> <?php echo $this->item->introtext; ?> </div> <?php endif; ?> <?php if($this->item->params->get('catItemExtraFields') && count($this->item->extra_fields)): ?> <!-- Item extra fields --> <div class="catItemExtraFields"> <h4><?php echo JText::_('Additional Info'); ?></h4> <ul> <?php foreach ($this->item->extra_fields as $key=>$extraField): ?> <li class="<?php echo ($key%2) ? "odd" : "even"; ?> type<?php echo ucfirst($extraField->type); ?> group<?php echo $extraField->group; ?>"> <span class="catItemExtraFieldsLabel"><?php echo $extraField->name; ?></span> <span class="catItemExtraFieldsValue"><?php echo $extraField->value; ?></span> </li> <?php endforeach; ?> </ul> <div class="clr"></div> </div> <?php endif; ?>
Ca fait 10 jours que j'essaie de faire ca, autant dire que je remercie vraiment d'avance la personne qui m'aidera!
Partager