header et conflits resolus

This commit is contained in:
armansansd 2021-06-24 14:07:19 +02:00
commit c87d8dbf9b
8 changed files with 199 additions and 9 deletions

26
.vscode/launch.json vendored Normal file
View File

@ -0,0 +1,26 @@
{
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"name": "Listen for Xdebug",
"type": "php",
"request": "launch",
"serverSourceRoot":"192.168.0.21"
"port": 9001,
"pathMappings": {
"/var/www/d9": "${workspaceFolder}"
},
},
{
"name": "Launch currently open script",
"type": "php",
"request": "launch",
"program": "${file}",
"cwd": "${fileDirname}",
"port": 9001
}
]
}

View File

@ -5,8 +5,46 @@
parameters:
http.response.debug_cacheability_headers: true
twig.config:
# Twig debugging:
#
# When debugging is enabled:
# - The markup of each Twig template is surrounded by HTML comments that
# contain theming information, such as template file name suggestions.
# - Note that this debugging markup will cause automated tests that directly
# check rendered HTML to fail. When running automated tests, 'debug'
# should be set to FALSE.
# - The dump() function can be used in Twig templates to output information
# about template variables.
# - Twig templates are automatically recompiled whenever the source code
# changes (see auto_reload below).
#
# For more information about debugging Twig templates, see
# https://www.drupal.org/node/1906392.
#
# Not recommended in production environments
# @default false
debug: true
# Twig auto-reload:
#
# Automatically recompile Twig templates whenever the source code changes.
# If you don't provide a value for auto_reload, it will be determined
# based on the value of debug.
#
# Not recommended in production environments
# @default null
auto_reload: true
# Twig cache:
#
# By default, Twig templates will be compiled and stored in the filesystem
# to increase performance. Disabling the Twig cache will recompile the
# templates from source each time they are used. In most cases the
# auto_reload setting above should be enabled rather than disabling the
# Twig cache.
#
# Not recommended in production environments
# @default true
cache: false
services:
cache.backend.null:
class: Drupal\Core\Cache\NullBackendFactory

File diff suppressed because one or more lines are too long

View File

@ -9,7 +9,7 @@ $(function(){
$(this).parent().fadeOut();
});
$('.open-block').click(function(){
$(this).prev().fadeIn();
$(this).prev().css("display","grid");
});

View File

@ -53,10 +53,49 @@ function popsu_preprocess_region(&$variables) {
}
// function popsu_theme_suggestions_views_view_alter(array &$suggestions, array $variables) {
// $elem = $variables;
// //$suggestions[] = 'views_view__headerView';
// /*if($variables['elements']['#id'] == 'customsearchform'){
// $suggestions[] = 'block__custom_search_form';
// }*/
// }
/**
* Implements hook_preprocess_block().
*/
function popsu_preprocess_views_view_field(&$variables){
// check if link to entoty option is true
$settings = $variables['field']->options['settings'];
if ($settings['link_to_entity']) {
// get the entity and build the classes
$entity = $variables['row']->_entity;
// build new classes
$new_classes = array(
$entity->getEntityTypeId(),
$entity->getEntityTypeId().'-'.$entity->bundle(),
$entity->getEntityTypeId().'-'.$entity->bundle().'-'.$entity->id()
);
// get the entity link and url
$link = $entity->toLink();
$url = $entity->toLink()->getUrl();
// set the active_class option to the url
$url->setOption('set_active_class', true);
// add new classes to the url (without overwriting existing once)
$options = $url->getOptions();
if(isset($options['attributes']) && $attributes = $options['attributes']){
if(isset($attributes['class']) && $classes = $attributes['class']){
$attributes['class'] += $new_classes;
}else{
$attributes['class'] = $new_classes;
}
}else{
$attributes = array(
"class" => $new_classes
);
}
$url->setOption('attributes', $attributes);
// update the url of the link
$link->setUrl($url);
// overwrite the output
$variables['output'] = $link->toRenderable();
}
}

View File

@ -0,0 +1,39 @@
{#
/**
* @file
* Default theme implementation to display a block.
*
* Available variables:
* - plugin_id: The ID of the block implementation.
* - label: The configured label of the block if visible.
* - configuration: A list of the block's configuration values.
* - label: The configured label for the block.
* - label_display: The display settings for the label.
* - provider: The module or other provider that provided this block plugin.
* - Block plugin specific settings will also be stored here.
* - content: The content of this block.
* - attributes: array of HTML attributes populated by modules, intended to
* be added to the main container tag of this template.
* - id: A valid HTML ID and guaranteed unique.
* - title_attributes: Same as attributes, except applied to the main title
* tag that appears in the template.
* - title_prefix: Additional output populated by modules, intended to be
* displayed in front of the main title tag that appears in the template.
* - title_suffix: Additional output populated by modules, intended to be
* displayed after the main title tag that appears in the template.
*
* @see template_preprocess_block()
*
* @ingroup themeable
*/
#}
<div id="{{ derivative_plugin_id }}" {{ attributes }}>
{{ title_prefix }}
{% if label %}
<h2{{ title_attributes }}>{{ label }}</h2>
{% endif %}
{{ title_suffix }}
{% block content %}
{{ content }}
{% endblock %}
</div>

View File

@ -0,0 +1,25 @@
{#
/**
* @file
* Default theme implementation to display a one-column layout.
*
* Available variables:
* - content: The content for this layout.
* - attributes: HTML attributes for the layout <div>.
*
* @ingroup themeable
*/
#}
{%
set classes = [
'layout',
'layout--onecol',
]
%}
{% if content %}
<div{{ attributes.addClass(classes) }}>
<div {{ region_attributes.content.addClass('layout__region', 'layout__region--content') }}>
{{ content.content }}
</div>
</div>
{% endif %}

View File

@ -0,0 +1,23 @@
{#
/**
* @file
* Default theme implementation for a single field in a view.
*
* Available variables:
* - view: The view that the field belongs to.
* - field: The field handler that can process the input.
* - row: The raw result of the database query that generated this field.
* - output: The processed output that will normally be used.
*
* When fetching output from the row this construct should be used:
* data = row[field.field_alias]
*
* The above will guarantee that you'll always get the correct data, regardless
* of any changes in the aliasing that might happen if the view is modified.
*
* @see template_preprocess_views_view_field()
*
* @ingroup themeable
*/
#}
{{ output -}}