瀏覽代碼

diaporama layout

bach 2 周之前
父節點
當前提交
03412b3ac1

+ 1 - 1
config/sync/core.entity_view_display.node.ressource.default.yml

@@ -76,7 +76,7 @@ content:
     region: content
   field_diaporama:
     type: image
-    label: above
+    label: hidden
     settings:
       image_link: ''
       image_style: ''

+ 30 - 10
config/sync/page_manager.page_variant.node-panels_variant-5.yml

@@ -38,7 +38,7 @@ variant_settings:
           link_to_entity: false
         third_party_settings: {  }
       region: second
-      weight: -3
+      weight: -4
       uuid: cc44ae59-b6ba-47d3-9224-1d6ef82de485
     68ed5c37-232a-4554-b1e6-a598cc1b01d4:
       id: 'entity_field:node:body'
@@ -70,7 +70,7 @@ variant_settings:
         settings: {  }
         third_party_settings: {  }
       region: second
-      weight: -4
+      weight: -5
       uuid: d2a161df-e7fa-4cd7-8a6c-442702667034
     3019fd91-6735-471b-a429-005dd320f5bd:
       id: 'entity_field:node:field_collections'
@@ -87,7 +87,7 @@ variant_settings:
           link: false
         third_party_settings: {  }
       region: second
-      weight: -1
+      weight: -2
       uuid: 3019fd91-6735-471b-a429-005dd320f5bd
     f9eaed57-bcce-43db-a937-e44f84cde262:
       id: 'entity_field:node:field_image'
@@ -105,7 +105,7 @@ variant_settings:
           image_style: very_large
         third_party_settings: {  }
       region: second
-      weight: -5
+      weight: -6
       uuid: f9eaed57-bcce-43db-a937-e44f84cde262
     11c9521f-c1c5-4a3a-b735-b013ea51b5d7:
       id: 'entity_field:node:field_programme'
@@ -122,7 +122,7 @@ variant_settings:
           link: true
         third_party_settings: {  }
       region: second
-      weight: -7
+      weight: -8
       uuid: 11c9521f-c1c5-4a3a-b735-b013ea51b5d7
     6b899160-a218-4412-9aae-15bf077ffab8:
       id: 'entity_field:node:field_date_de_parution'
@@ -143,7 +143,7 @@ variant_settings:
           time_wrapper: false
         third_party_settings: {  }
       region: second
-      weight: 0
+      weight: -1
       uuid: 6b899160-a218-4412-9aae-15bf077ffab8
     6957b522-39a6-4094-a338-4908b79bd5dd:
       id: 'entity_field:node:field_theme'
@@ -160,7 +160,7 @@ variant_settings:
           link: true
         third_party_settings: {  }
       region: second
-      weight: 1
+      weight: 0
       uuid: 6957b522-39a6-4094-a338-4908b79bd5dd
     5a3cd52c-80b0-48ab-ad5b-102a0572cc10:
       id: 'entity_field:node:field_type_de_ressource'
@@ -177,7 +177,7 @@ variant_settings:
           link: false
         third_party_settings: {  }
       region: second
-      weight: -6
+      weight: -7
       uuid: 5a3cd52c-80b0-48ab-ad5b-102a0572cc10
     99f61c86-31f2-41b7-a344-f398bbae87a5:
       id: 'block_content:1911abcd-dd85-403d-8e6e-8621c9f2045a'
@@ -226,7 +226,7 @@ variant_settings:
           height: 480
         third_party_settings: {  }
       region: second
-      weight: 2
+      weight: 1
       uuid: c80516af-557e-426b-ba94-dc32e53016e0
     31cf12fb-4adf-489d-ae14-9f4fddcac1c4:
       id: 'entity_field:node:field_ressources_liees'
@@ -298,7 +298,7 @@ variant_settings:
           link_to_entity: false
         third_party_settings: {  }
       region: second
-      weight: -2
+      weight: -3
       uuid: b4e55d8c-4700-45ba-9b04-f48ad1ff7f38
     0d80d9b0-5425-4e6c-a886-4c50c9e60317:
       id: 'views_block:collection-block_1'
@@ -316,6 +316,26 @@ variant_settings:
       region: third
       weight: 0
       uuid: 0d80d9b0-5425-4e6c-a886-4c50c9e60317
+    f481538f-3161-4d17-8ef7-b74bb27246dd:
+      id: 'entity_field:node:field_diaporama'
+      label: Diaporama
+      label_display: '0'
+      provider: ctools_block
+      context_mapping:
+        entity: node
+      formatter:
+        type: image
+        weight: 0
+        label: hidden
+        settings:
+          image_link: ''
+          image_style: wide
+          image_loading:
+            attribute: lazy
+        third_party_settings: {  }
+      region: second
+      weight: 2
+      uuid: f481538f-3161-4d17-8ef7-b74bb27246dd
   page_title: ''
   layout: layout_threecol_25_50_25
   layout_settings:

文件差異過大導致無法顯示
+ 0 - 0
web/themes/custom/popsu/assets/css/styles.min.css


文件差異過大導致無法顯示
+ 0 - 0
web/themes/custom/popsu/assets/js/main.js


+ 32 - 2
web/themes/custom/popsu/lib/script.js

@@ -320,12 +320,12 @@ if($(".page-node-type-programme").length > 0 || $(".page-node-type-projet").leng
 
 
 	//page projet
-	$("#programme_toc-block_10 h3, #programme_toc-block_18 h3").on('click', function(){
+	$("#programme_toc-block_10 h3").on('click', function(){
 		// pour territoire
 		$(this).nextUntil("h3").fadeToggle();
 
 	});
-
+	
 	//page programme
 	// pour territoire (h3 are regions)
 	$("#programme_toc-block_4 h3").on('click', function(){
@@ -502,6 +502,36 @@ if($(".page-node-type-ressource").find(".ressources-video").length > 0){
 	$(vid).clone().insertAfter(prog);
 	$(vid).remove();
 
+	
+}
+
+//spec ressources diaporama 
+if($(".page-node-type-ressource").find(".ressources-reportage-photographique").length > 0){
+	
+	let diapo = $("#node\\:field_diaporama");
+	let prog = $("#node\\:field_programme");
+	$(diapo).clone().insertAfter(prog);
+	$(diapo).remove();
+
+	let elem = $(".content_container").find("#node\\:field_diaporama>div.field_diaporama");
+	console.log('elem', elem);
+	$(elem[0]).slick({
+		slidesToShow: 1,
+		slidesToScroll: 1,
+		centerMode: false,
+		centerPadding: '60px',
+		responsive: [
+			{
+				breakpoint: 800,
+				settings: {
+					slidesToShow: 1,
+					slidesToScroll: 1,
+					centerMode: true,
+					centerPadding: '30px',
+				}
+				}]
+	});
+	
 }
 
 //ressources page projet

+ 21 - 5
web/themes/custom/popsu/popsu.theme

@@ -40,13 +40,29 @@ function popsu_preprocess_html(&$variables) {
   }
 }
 
-function popsu_preprocess_page(&$variables) {
-  if(isset($variables['node'])){
+// function popsu_preprocess_page(&$variables) {
+//   if(isset($variables['node'])){
+//     $node = $variables['node'];
+//     if(isset($node) && $node->hasField('field_videos') && $node->get('field_videos')->getString() != ""){
+//       $variables['attributes']['class'][] = 'ressources-video';
+//     }
+//   }
+// }
+
+function popsu_preprocess_page__node(&$variables) {
   $node = $variables['node'];
-  if(isset($node) && $node->hasField('field_videos') && $node->get('field_videos')->getString() != ""){
-    $variables['attributes']['class'][] = 'ressources-video';
-  }
+  if($node->getType() === "ressource"){
+    $type_ref_entity = $node->get('field_type_de_ressource')->referencedEntities();
+    if(count($type_ref_entity)){
+      // $type = filter_var(strtolower(str_replace(" ", "-", $type_ref_entity[0]->getName())), FILTER_SANITIZE_URL);
+      // setlocale(LC_ALL, "en_US.utf8");
+      // $type = iconv('UTF-8','ASCII//TRANSLIT//IGNORE',strtolower(str_replace(" ", "-", $type_ref_entity[0]->getName())));
+      $trans = \Drupal::transliteration();
+      $type = $trans->transliterate(strtolower(str_replace(" ", "-", $type_ref_entity[0]->getName())), 'en');
+      $variables['attributes']['class'][] = 'ressources-' . $type;
+    }
   }
+
 }
 
 function popsu_preprocess_node(&$variables){

+ 10 - 0
web/themes/custom/popsu/sass/pages/_ressources.scss

@@ -873,4 +873,14 @@
 			margin: 0rem 0 1rem 0;
 		}
 	}
+	.ressources-reportage-photographique{
+		#node\:field_image{
+			display: none;
+		}
+
+		#node\:field_type_de_ressource{
+			padding: 0;
+
+		}
+	}
 }

部分文件因文件數量過多而無法顯示