diaporama layout

This commit is contained in:
Bachir Soussi Chiadmi 2024-04-29 11:02:04 +02:00
parent 482478f2ea
commit 03412b3ac1
7 changed files with 96 additions and 20 deletions

View File

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

View File

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

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -320,7 +320,7 @@ if($(".page-node-type-programme").length > 0 || $(".page-node-type-projet").leng
//page projet //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 // pour territoire
$(this).nextUntil("h3").fadeToggle(); $(this).nextUntil("h3").fadeToggle();
@ -502,6 +502,36 @@ if($(".page-node-type-ressource").find(".ressources-video").length > 0){
$(vid).clone().insertAfter(prog); $(vid).clone().insertAfter(prog);
$(vid).remove(); $(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 //ressources page projet

View File

@ -40,13 +40,29 @@ function popsu_preprocess_html(&$variables) {
} }
} }
function popsu_preprocess_page(&$variables) { // function popsu_preprocess_page(&$variables) {
if(isset($variables['node'])){ // 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']; $node = $variables['node'];
if(isset($node) && $node->hasField('field_videos') && $node->get('field_videos')->getString() != ""){ if($node->getType() === "ressource"){
$variables['attributes']['class'][] = 'ressources-video'; $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){ function popsu_preprocess_node(&$variables){

View File

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