Medias rendered in home.ctp

If you want to have some Medias just in home of your project,
just set to home when ordering a media. Then in the PagesController, load the model Media with only home images and loop images in the view with (for carousel exemple) : 

<section class="covers">
    <div id="foo">
<?php $medias = current($medias) ; ?>
<?php foreach($medias as $media): $medias = current($medias);?>
    
  <?php echo $this->Media->image($media['Media']['icon'], 700,320); ?>

<?php endforeach; ?>
    
    <div class="clearfix"></div>

   
    <a class="prev" id="foo2_prev" href="#"><span>prev</span></a>
    <a class="next" id="foo2_next" href="#"><span>next</span></a>
    
</div>	
	
</section>

in the Controller, for pages add this : 
public function display() {
            $medias = $this->loadModel('Media.Media');
            $allmedias['medias']=$this->Media->findAllByIsHome(1);
            $d["medias"] = $allmedias;
            $this->set(compact('medias'));
            $this->set($d); ... }