<?php
	$e = $this->item;
	$params = $this->params;
	$articleClass  = $this->articleClass ;

$link =  $this->baseUrl( $e->url );
$img = null;
if( !empty($e->image) && $tn = $this->smallImage( $e->image,array('xsize'=>60,'ysize'=>60,'prefix'=>'tn') )):
		$img = 	'<a href="'. ($params['imglink']?$link:$e->image).'" '. ($params['imglink']?'':'rel="lightbox"') .' class="image"><img src="'.$tn .'" alt="'. $e->title .'" /></a>';
endif;

$topMeta = '<time datetime="'.$e->date( 'validFrom' )->get( Zend_Date::ISO_8601 ).'">'. $e->date( 'validFrom' )->get( $params['dateFormat'] ) .'</time>';



	?>

<article class="<?php echo $e->scope.' '.($img?' hasImage':'') ?>" >
		<header>
			<a href="<?php echo $this->baseUrl( $link ); ?>">
				<?php if($params['topmeta'] && $params['topmetapos']=='up' ) echo $topMeta; ?>
				<h2 class="<?= $articleClass ?>"><?php echo $e->title; ?></h2>
				<?php if($params['topmeta'] && $params['topmetapos']=='down' ) echo $topMeta; ?>
			</a>
		</header>


		<?php
		if($params['imgtop'])  :
			echo $img;
		endif; //img  ?>
		<?php
				echo $this->replaceContent( $e->content );
		?>

		<?php if( !empty($e->file) ) : ?>
		<footer>
			<a href="<?= $e->file ?>" class="btn btn-md btn-primary">Télécharger le fichier</a>
		</footer>
		<?php endif; ?>


		<div class="clearfix"></div>
	</article>
