add tags in homepage
authorGautier Thibault <gthibault@universcine.com>
Tue, 20 Apr 2010 16:42:31 +0200
changeset 70 9452e144c4d4
parent 69 c19b7400ac1b
child 71 77de27265833
add tags in homepage
web/thdProject/apps/frontend/modules/homepage/actions/components.class.php
web/thdProject/apps/frontend/modules/homepage/templates/_tagList.php
--- a/web/thdProject/apps/frontend/modules/homepage/actions/components.class.php	Tue Apr 20 16:32:16 2010 +0200
+++ b/web/thdProject/apps/frontend/modules/homepage/actions/components.class.php	Tue Apr 20 16:42:31 2010 +0200
@@ -7,12 +7,20 @@
   }
   public function executeTagList() {
     // FIXME: Dummy value
+    $this->tagList = Array();
     $this->tag = Array('score' => 3);
+    // Get Tags in Segment list
+    $query = Doctrine_Query::create()
+        ->from('ThdSegment S')
+        ->limit(5);
+    $this->tagsList = $query->execute();
+
   }
 
   public function executeRandomFilm() {
     // FIXME: Dummy value
     $this->tag = Array('score' => 3);
+   
   }
 
   public function executeLastTaggedList() {
--- a/web/thdProject/apps/frontend/modules/homepage/templates/_tagList.php	Tue Apr 20 16:32:16 2010 +0200
+++ b/web/thdProject/apps/frontend/modules/homepage/templates/_tagList.php	Tue Apr 20 16:42:31 2010 +0200
@@ -1,14 +1,14 @@
 <div id="tag">
 	<h3 class="head">Navigation par tag :</h3>
 	<ul class="item-list tag-list">
-	  <li class="tag-score-<?php echo $tag['score']; ?>">
-	    <a href="<?php echo url_for('@tagging?tag=anna'); ?>">anna</a>
-	  </li><li class="tag-score-5">
-	    <a href="<?php echo url_for('@tagging?tag=Jalousie'); ?>">Jalousie</a>
-	  </li><li class="tag-score-3">
-	    <a href="<?php echo url_for('@tagging?tag=erotomanie'); ?>">erotomanie</a>
-	  </li><li class="tag-score-2">
-	    <a href="<?php echo url_for('@tagging?tag=violence'); ?>">violence</a>
-	  </li>
+	  <?php 
+	    foreach($tagList as $item) {
+	    	if($item){ 
+	    	$tag = $item['tagName'];
+	    	echo '<li class="tag-score-'.$tag['score'].'"><a href="">'.$tag.'</a>
+	      </li>';
+	        
+	    }
+    } ?>
 	</ul>
 </div>
\ No newline at end of file