Browse Source

ajout des class popsu au view des ressources

armansansd 2 năm trước cách đây
mục cha
commit
c6b5cabdbf

+ 3 - 2
web/themes/custom/popsu/css/styles.css

@@ -1382,8 +1382,9 @@ footer {
       margin-bottom: 1rem; }
     .path-centre-de-ressources .views-view-grid .views-col .views-field-field-type-de-ressource {
       text-transform: uppercase;
-      font-size: 500;
-      margin-bottom: .5rem; }
+      font-size: 600;
+      margin-bottom: .5rem;
+      font-size: 0.45rem; }
     .path-centre-de-ressources .views-view-grid .views-col .views-field-title {
       font-style: italic; }
     .path-centre-de-ressources .views-view-grid .views-col .views-field-field-sous-titre {

Những thai đổi đã bị hủy bỏ vì nó quá lớn
+ 0 - 0
web/themes/custom/popsu/css/styles.css.map


+ 26 - 16
web/themes/custom/popsu/popsu.theme

@@ -27,17 +27,16 @@ function popsu_preprocess_views_view_unformatted(&$variables) {
             $variables['rows'][$id]['attributes']->addClass("popsu-node-".$c);
             //kint($variables['rows'][$id]['content']["#row"]->nid);
         }
-
-
-  }else{
-    if ($view->current_display == "block_1") {
-        $rows = $variables['rows'];
-        foreach ($rows as $id => $row) {
-            $variables['rows'][$id]['attributes'] = new Attribute();
-            $c = $variables['rows'][$id]['content']["#row"]->nid;
-            $variables['rows'][$id]['attributes']->addClass("popsu-node-".$c);
-        }
-    }
+  }
+  // else{
+  //   if ($view->current_display == "block_1") {
+  //       $rows = $variables['rows'];
+  //       foreach ($rows as $id => $row) {
+  //           $variables['rows'][$id]['attributes'] = new Attribute();
+  //           $c = $variables['rows'][$id]['content']["#row"]->nid;
+  //           $variables['rows'][$id]['attributes']->addClass("popsu-node-".$c);
+  //       }
+  //   }
 
   }
 };
@@ -70,9 +69,18 @@ function popsu_preprocess_region(&$variables) {
 /**
  * Implements hook_preprocess_block().
  */
-// function popsu_preprocess_block(&$variables) {
-//   $t="t";
-// }
+
+function popsu_preprocess_views_view_fields(&$variables){
+  
+  $entity = $variables['row']->_entity;
+  if($entity->hasField('field_programme')){
+      $target_id = $entity->get('field_programme')->getString();
+      // kint($variables);die();
+      // $variables['row']['attributes'] = new Attribute();
+      // $variables['row']['attributes']->addClass("pouet-node-".$target_id);     
+  }
+ 
+}
 
 function popsu_preprocess_views_view_field(&$variables){
   // check if link to entoty option is true
@@ -80,14 +88,16 @@ function popsu_preprocess_views_view_field(&$variables){
   if (isset($settings['link_to_entity']) && $settings['link_to_entity']) {
     // get the entity and build the classes
     $entity = $variables['row']->_entity;
-    // $target_id = $entity;
+
     // build new classes
     $new_classes = array(
       $entity->getEntityTypeId(),
       $entity->getEntityTypeId().'-'.$entity->bundle(),
-      $entity->getEntityTypeId().'-'.$entity->bundle().'-'.$entity->id()
+      $entity->getEntityTypeId().'-'.$entity->bundle().'-'.$entity->id(),
     );
     
+
+    
     // get the entity link and url
     $link = $entity->toLink(); 
     $url = $entity->toLink()->getUrl();

+ 2 - 1
web/themes/custom/popsu/sass/pages/_ressources.scss

@@ -56,8 +56,9 @@
 			}
 			.views-field-field-type-de-ressource{
 				text-transform: uppercase;
-				font-size: 500;
+				font-size: 600;
 				margin-bottom: .5rem;
+				font-size: $font-small;
 			}
 			.views-field-title{
 				font-style: italic;

Một số tệp đã không được hiển thị bởi vì quá nhiều tập tin thay đổi trong này khác