header et conflits resolus
This commit is contained in:
File diff suppressed because one or more lines are too long
@@ -9,7 +9,7 @@ $(function(){
|
||||
$(this).parent().fadeOut();
|
||||
});
|
||||
$('.open-block').click(function(){
|
||||
$(this).prev().fadeIn();
|
||||
$(this).prev().css("display","grid");
|
||||
});
|
||||
|
||||
|
||||
|
@@ -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();
|
||||
}
|
||||
}
|
||||
|
39
web/themes/custom/popsu/templates/layout/block.html.twig
Normal file
39
web/themes/custom/popsu/templates/layout/block.html.twig
Normal 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>
|
@@ -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 %}
|
@@ -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 -}}
|
Reference in New Issue
Block a user