create theme rorschach

This commit is contained in:
2023-06-07 10:56:29 +02:00
parent 607e3db955
commit 5215892dbf
227 changed files with 43693 additions and 0 deletions
@@ -0,0 +1,5 @@
# Schema for the configuration files of the eql theme.
eql.settings:
type: theme_settings
label: 'EQL settings'
@@ -0,0 +1,2 @@
.body {
margin: 0; }
@@ -0,0 +1 @@
/* Colors used for EQL */
@@ -0,0 +1,3 @@
.field--name-field-textes {
grid-column-start: 2;
grid-column-end: 7; }
File diff suppressed because it is too large Load Diff
File diff suppressed because one or more lines are too long
+18
View File
@@ -0,0 +1,18 @@
eql.mobile:
label: mobile
mediaQuery: '(min-width: 0px)'
weight: 0
multipliers:
- 1x
eql.narrow:
label: narrow
mediaQuery: 'all and (min-width: 480px) and (max-width: 959px)'
weight: 1
multipliers:
- 1x
eql.wide:
label: wide
mediaQuery: 'all and (min-width: 960px)'
weight: 2
multipliers:
- 1x
+27
View File
@@ -0,0 +1,27 @@
name: EQL
type: theme
description: 'EQL theme.'
package: Core
version: VERSION
core_version_requirement: ^8.8 || ^9
base theme: false
libraries:
- eql/global-css
- eql/global-js
regions:
header_top_left: 'Header top left'
header_top_rigth: 'Header top right'
header_bottom: 'Header Bottom'
help: Help
page_top: 'Page top'
content: Content
sidebar_first: 'Sidebar first'
sidebar_second: 'Sidebar second'
page_bottom: 'Page bottom'
footer_top: 'Footer top'
footer_bottom_left: 'Footer bottom left'
footer_bottom_middle: 'Footer bottom middle'
footer_bottom_right: 'Footer bottom right'
+11
View File
@@ -0,0 +1,11 @@
global-css:
css:
theme:
css-compiled/styles.css: {}
# css-prefixed/styles.css: {}
global-js:
js:
scripts/main.js: {}
dependencies:
- core/jquery
+123
View File
@@ -0,0 +1,123 @@
<?php
/*
* @files
* Theme Template Funtions
*/
// use Drupal\Core\Template\Attribute;
// use Drupal\Core\Link;
// use Drupal\Core\Url;
function eql_preprocess_html(&$variables) {
$node = \Drupal::routeMatch()->getParameter('node');
if ($node){
$variables['attributes']['class'][] = 'node-type-' . $node->bundle();
$variables['attributes']['class'][] = 'node-id-' . $node->id();
}
}
function eql_preprocess_node(&$variables){
$node = &$variables['node'];
$variables['attributes']['class'][] = 'node-type-' . $node->gettype();
if($node->gettype() == "actualite") {
$actu_type = $node->get('field_actu_type')->getString();
$variables['attributes']['class'][] = 'actu-type-' . $actu_type;
}
if($node->gettype() == "offre_de_service") {
$type_protagoniste = $node->get('field_type_de_protagoniste')->getString();
$variables['attributes']['class'][] = 'type-de-protagoniste-' . $type_protagoniste;
}
}
function eql_preprocess_field(&$variables) {
$node = \Drupal::routeMatch()->getParameter('node');
$field_name = &$variables['field_name'];
if($node) {
if ($field_name == 'field_type_de_protagoniste'){
$type_protagoniste = $node->get('field_type_de_protagoniste')->getString();
$variables['attributes']['class'][] = 'type-de-protagoniste-' . $type_protagoniste;
}
}
}
//////////////////////////////////////////////////
// function eql_preprocess_field(&$variables){
// $node = &$variables['node'];
// $variables['attributes']['class'][] = 'node-type-' . $node->gettype();
// if($node->gettype() == "offre_de_service") {
// $type_protagoniste = $node->get('field_type_de_protagoniste')->getString();
// $variables['attributes']['class'][] = 'type-de-protagoniste-' . $type_protagoniste;
// }
// }
// function MYTHEME_preprocess_field__MYFIELD(&$variables) {
// if ($variables['element']['#entity_type'] === 'node') {
// $node = $variables['element']['#object'];
// $nid = $node->id();
// $variables['myurl'] = \Drupal::service('path.alias_manager')->getAliasByPath('/node/' . $nid);
// }
// }
// function template_preprocess_block(&$variables) {
// $node = &$variables['node'];
// $variables['attributes']['class'][] = 'node-type-' . $node->gettype();
// if($node->gettype() == "offre_de_service") {
// $type_protagoniste = $node->get('field_type_de_protagoniste')->getString();
// $variables['attributes']['class'][] = 'type-de-protagoniste-' . $type_protagoniste;
// }
// }
///////////////////////////////////////////////////
///////////////////////////////////////////////////
// counter pour id
// function eql_preprocess_field(&$variables) {
// // static $counter = 0;
// // $variables['counter'] = $counter++;
// $variables['elements']['#paragraph']->item_id;
// }
// la fonction suivante ne fonctionne pas
// function eql_preprocess_field(&$variables) {
// $paragraph = &$variables['paragraph'];
// $variables['attributes']['class'][] = 'paragraph-type-' . $paragraph->id();
// $hook_id = $paragraph->get('paragraph-id--')->getString();
// $variables['attributes']['class'][] = 'hook-id-' . $hook_id;
// }
//might be useful for if-clause: $variables['field_name'] and $variables['field_type']
// if ($paragraph && $paragraph->getEntityTypeId() == 'paragraph' . $paragraph->id() ) {
//whatever logic you need goes here, e.g. something like
//$variables['attributes']['data-from-parent-paragraph'] = $parentEntity->getYourStuff();
// }
// function yourtheme_preprocess_field(&$variables, $hook) {
// $element = $variables['element'];
// $parentEntity = $element['#object'];
// //might be useful for if-clause: $variables['field_name'] and $variables['field_type']
// if ($parentEntity && $parentEntity->getEntityTypeId() == 'paragraph' ) {
// //whatever logic you need goes here, e.g. something like
// //$variables['attributes']['data-from-parent-paragraph'] = $parentEntity->getYourStuff();
// }
// }
// $variables['elements']['#entity']->item_id;
// function MYTHEME_preprocess_views_view_fields__view_machine_name(&$vars) {
// static $counter = 0;
// $vars['counter'] = $counter++;
// }
File diff suppressed because it is too large Load Diff

After

Width:  |  Height:  |  Size: 434 KiB

File diff suppressed because it is too large Load Diff

After

Width:  |  Height:  |  Size: 169 KiB

File diff suppressed because it is too large Load Diff

After

Width:  |  Height:  |  Size: 144 KiB

File diff suppressed because it is too large Load Diff

After

Width:  |  Height:  |  Size: 296 KiB

File diff suppressed because one or more lines are too long

After

Width:  |  Height:  |  Size: 977 KiB

File diff suppressed because it is too large Load Diff

After

Width:  |  Height:  |  Size: 120 KiB

Some files were not shown because too many files have changed in this diff Show More