added file field to home showrooms

This commit is contained in:
Bachir Soussi Chiadmi 2021-08-24 23:23:08 +02:00
parent 12f7bacc26
commit 94fe587324
6 changed files with 42 additions and 3 deletions

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -1064,6 +1064,7 @@ article.node--type-frontpage{
@extend %part-columned-layout;
.field--name-field-showrooms{}
.field--name-field-showroom-links{
display: inline-block;
.field__item{
display: inline-block;
a{
@ -1073,6 +1074,19 @@ article.node--type-frontpage{
}
}
}
.field--name-field-showroom-files{
display: inline-block;
.field__item{
display: inline-block;
span.file{
@include btn;
padding-left: 25px;
background-position-x: 5px;
background-color: #fff;
color: $color-showrooms;
}
}
}
.field--name-computed-showrooms-reference{
overflow: hidden;
position:relative;

View File

@ -403,3 +403,11 @@ function materiotheme_preprocess_field__node__field_showrooms__frontpage(array &
"href" => '/' . $variables['element']['#language'] . '/showrooms'
);
}
function materiotheme_preprocess_file_link(array &$variables) {
$url = $variables['link']['#url'];
$attributes = $url->getOption('attributes');
$attributes['target'] = '_blank';
$url->setOption('attributes', $attributes);
$t="t";
}

View File

@ -0,0 +1,17 @@
{#
/**
* @file
* Theme override for a link to a file.
*
* Available variables:
* - attributes: The HTML attributes for the containing element.
* - link: A link to the file.
* - icon: The icon image representing the file type.
* - file_size: The size of the file.
*
* @see template_preprocess_file_link()
* @see stable_preprocess_image_widget()
*/
#}
{{ attach_library('classy/file') }}
<span{{ attributes }}>{{ icon }} {{ link }}</span>