Bonjour à tous,
j'ai un problème par rapport à l'affichage de mes articles en blog.
Sur ma page d'accueil j'affiche les articles d'une catégories en blog, et je souhaite afficher en premier les deux derniers articles en vedette publié de la même catégorie.
Pour cela j'ai modifié le fichier blog.php (component/com_content/category), mon problème est que j'affiche que le dernier publié.
Voila mon code qui affiche bien un article en vedette, si quelqu'un peut m'aider svp à afficher le deuxième :

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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
<?php if ($this->params->get('show_description', 1) || $this->params->def('show_description_image', 1)) : ?>
	<div class="category-desc">
	<?php if ($this->params->get('show_description_image') && $this->category->getParams()->get('image')) : ?>
		<img src="<?php echo $this->category->getParams()->get('image'); ?>"/>
	<?php endif; ?>
	<?php if ($this->params->get('show_description') && $this->category->description) : ?>
		<?php echo JHtml::_('content.prepare', $this->category->description, '', 'com_content.category'); ?>
	<?php endif; ?>
	<div class="clr"></div>
	</div>
<?php endif; ?>
<?php if (empty($this->lead_items) && empty($this->link_items) && empty($this->intro_items)) : ?>
	<?php if ($this->params->get('show_no_articles', 1)) : ?>
		<p><?php echo JText::_('COM_CONTENT_NO_ARTICLES'); ?></p>
	<?php endif; ?>
<?php endif; ?>
	<?php $leadingcount = 0; ?>
	<?php if (false && !empty($this->lead_items)) : ?>
		<div class="items-leading clearfix" id="leadarticle" style="min-height: 135px">
			<?php foreach ($this->lead_items as &$item) : ?>
				<div
					class="leading-<?php echo $leadingcount; ?><?php echo $item->state == 0 ? ' system-unpublished' : null; ?>">
					<?php
					$this->item = & $item;
					echo $this->loadTemplate('item');
					?>
				</div>
				<?php $leadingcount++; ?>
			<?php endforeach; ?>
		</div><!-- end items-leading -->
                <script>
                    jQuery("#leadarticle h2").css({"font-size":"16px"});
                </script>
	<?php endif; ?>

<?php
	$this->lead = 0;
	$introcount = (count($this->intro_items));
	$counter = 0;
?>
<?php //if (true || !empty($this->intro_items)) : 
if (true ) :


?>
	<?php
		$featured = 1;
		$feat_data = array();
		foreach ($this->lead_items as $key => &$item){
			if($item->featured && $featured){
				$featured = 0;
				$feat_data = $item;
				break;
			}
		}
		if($feat_data&&!empty($this->lead_items)){


?>
<?php if ($this->params->get('show_page_heading') != 0 or $this->params->get('show_category_title')) : ?>
<h1 id="hightitle-article">
	<?php echo $this->escape($this->params->get('page_heading')); ?>
</h1>
<?php endif; ?>
	<!-- start items-leading
		<h1><?php echo $this->escape($this->params->get('page_heading')); ?></h1> -->
		<div class="items-leading clearfix" id="leadarticle"  style="min-height: 135px">

// ici j'aimerai afficher deux article au lieu de 1 !!
			<article style="padding-bottom: 30px;" class="leading-<?php echo $leadingcount; ?><?php echo $item->state == 0 ? 'system-unpublished' : null; ?>">
				<?php
					$this->lead = 1;
					$this->item = $feat_data;
					echo $this->loadTemplate('item');
					$this->lead = 0;
				?>
			</article>
			                
		</div>
                <script>
                    jQuery("#leadarticle h2").css({"font-size":"16px"});
                </script>

<!-- end items-leading -->