home sections labels link made active
This commit is contained in:
@@ -255,7 +255,7 @@ content:
|
|||||||
region: content
|
region: content
|
||||||
label: hidden
|
label: hidden
|
||||||
settings:
|
settings:
|
||||||
link: true
|
link: false
|
||||||
third_party_settings: { }
|
third_party_settings: { }
|
||||||
field_a_database:
|
field_a_database:
|
||||||
weight: 6
|
weight: 6
|
||||||
|
|||||||
+1
-1
File diff suppressed because one or more lines are too long
Binary file not shown.
+1
-1
File diff suppressed because one or more lines are too long
Binary file not shown.
+2
-2
File diff suppressed because one or more lines are too long
@@ -951,9 +951,9 @@ article.node--type-frontpage{
|
|||||||
background-color: $color-base;
|
background-color: $color-base;
|
||||||
@extend %part-columned-layout;
|
@extend %part-columned-layout;
|
||||||
.field--name-field-a-database{
|
.field--name-field-a-database{
|
||||||
.field__label{
|
// .field__label{
|
||||||
cursor: pointer;
|
// cursor: pointer;
|
||||||
}
|
// }
|
||||||
}
|
}
|
||||||
.field--name-field-database-links{
|
.field--name-field-database-links{
|
||||||
.field__item{
|
.field__item{
|
||||||
|
|||||||
@@ -331,3 +331,24 @@ function materiotheme_preprocess_printable(array &$variables) {
|
|||||||
// $variables['attributes']['src'] = '/themes/custom/materiotheme/assets/img/blank.gif';
|
// $variables['attributes']['src'] = '/themes/custom/materiotheme/assets/img/blank.gif';
|
||||||
// }
|
// }
|
||||||
// }
|
// }
|
||||||
|
|
||||||
|
|
||||||
|
function materiotheme_preprocess_field__node__field_a_database__frontpage(array &$variables) {
|
||||||
|
if ($variables['logged_in']) {
|
||||||
|
$variables['label_link'] = array(
|
||||||
|
"href" => '/' . $variables['element']['#language'] . '/base'
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
function materiotheme_preprocess_field__node__field_blabla__frontpage(array &$variables) {
|
||||||
|
$variables['label_link'] = array(
|
||||||
|
"href" => '/' . $variables['element']['#language'] . '/blabla'
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
function materiotheme_preprocess_field__node__field_showrooms__frontpage(array &$variables) {
|
||||||
|
$variables['label_link'] = array(
|
||||||
|
"href" => '/' . $variables['element']['#language'] . '/showrooms'
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|||||||
+9
-1
@@ -67,7 +67,15 @@
|
|||||||
{% endif %}
|
{% endif %}
|
||||||
{% else %}
|
{% else %}
|
||||||
<div{{ attributes.addClass(classes) }}>
|
<div{{ attributes.addClass(classes) }}>
|
||||||
<div{{ title_attributes.addClass(title_classes) }} @click.prevent="onClickFieldLabel($event, 'database')">{{ label }}</div>
|
<div{{ title_attributes.addClass(title_classes) }}>
|
||||||
|
{% if label_link %}
|
||||||
|
<a href="{{ label_link.href }}" @click.prevent="onClickLink">
|
||||||
|
{{ label }}
|
||||||
|
</a>
|
||||||
|
{% else %}
|
||||||
|
{{ label }}
|
||||||
|
{% endif %}
|
||||||
|
</div>
|
||||||
{% if multiple %}
|
{% if multiple %}
|
||||||
<div class="field__items">
|
<div class="field__items">
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|||||||
+6
-2
@@ -68,9 +68,13 @@
|
|||||||
{% else %}
|
{% else %}
|
||||||
<div{{ attributes.addClass(classes) }}>
|
<div{{ attributes.addClass(classes) }}>
|
||||||
<div{{ title_attributes.addClass(title_classes) }}>
|
<div{{ title_attributes.addClass(title_classes) }}>
|
||||||
<a href="/blabla" @click.prevent="onClickLink">
|
{% if label_link %}
|
||||||
|
<a href="{{ label_link.href }}" @click.prevent="onClickLink">
|
||||||
|
{{ label }}
|
||||||
|
</a>
|
||||||
|
{% else %}
|
||||||
{{ label }}
|
{{ label }}
|
||||||
</a>
|
{% endif %}
|
||||||
</div>
|
</div>
|
||||||
{% if multiple %}
|
{% if multiple %}
|
||||||
<div class="field__items">
|
<div class="field__items">
|
||||||
|
|||||||
+6
-2
@@ -68,9 +68,13 @@
|
|||||||
{% else %}
|
{% else %}
|
||||||
<div{{ attributes.addClass(classes) }}>
|
<div{{ attributes.addClass(classes) }}>
|
||||||
<div{{ title_attributes.addClass(title_classes) }}>
|
<div{{ title_attributes.addClass(title_classes) }}>
|
||||||
<a href="/showrooms" @click.prevent="onClickLink">
|
{% if label_link %}
|
||||||
|
<a href="{{ label_link.href }}" @click.prevent="onClickLink">
|
||||||
|
{{ label }}
|
||||||
|
</a>
|
||||||
|
{% else %}
|
||||||
{{ label }}
|
{{ label }}
|
||||||
</a>
|
{% endif %}
|
||||||
</div>
|
</div>
|
||||||
{% if multiple %}
|
{% if multiple %}
|
||||||
<div class="field__items">
|
<div class="field__items">
|
||||||
|
|||||||
@@ -149,7 +149,7 @@ export default {
|
|||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
// find existing router route compared with link href
|
// find existing router route compared with link href
|
||||||
let pathbase = target.pathname.match(/^(\/\w{2}\/[^\/]+)\/.*/i)
|
let pathbase = target.pathname.match(/^(\/\w{2}\/[^\/]+)\/?.*/i)
|
||||||
console.log('pathbase', pathbase)
|
console.log('pathbase', pathbase)
|
||||||
|
|
||||||
for (let i = 0; i < this.$router.options.routes.length; i++) {
|
for (let i = 0; i < this.$router.options.routes.length; i++) {
|
||||||
@@ -175,8 +175,9 @@ export default {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
onClickFieldLabel(e){
|
onClickFieldLabel(e, part){
|
||||||
console.log("onClickFieldLabel", e, this.$router, this.$route)
|
console.log("onClickFieldLabel", part, e, this.$router, this.$route)
|
||||||
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
watch: {
|
watch: {
|
||||||
|
|||||||
Reference in New Issue
Block a user