home sections labels link made active
This commit is contained in:
@@ -255,7 +255,7 @@ content:
|
||||
region: content
|
||||
label: hidden
|
||||
settings:
|
||||
link: true
|
||||
link: false
|
||||
third_party_settings: { }
|
||||
field_a_database:
|
||||
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;
|
||||
@extend %part-columned-layout;
|
||||
.field--name-field-a-database{
|
||||
.field__label{
|
||||
cursor: pointer;
|
||||
}
|
||||
// .field__label{
|
||||
// cursor: pointer;
|
||||
// }
|
||||
}
|
||||
.field--name-field-database-links{
|
||||
.field__item{
|
||||
|
||||
@@ -331,3 +331,24 @@ function materiotheme_preprocess_printable(array &$variables) {
|
||||
// $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 %}
|
||||
{% else %}
|
||||
<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 %}
|
||||
<div class="field__items">
|
||||
{% endif %}
|
||||
|
||||
+6
-2
@@ -68,9 +68,13 @@
|
||||
{% else %}
|
||||
<div{{ attributes.addClass(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 }}
|
||||
</a>
|
||||
{% endif %}
|
||||
</div>
|
||||
{% if multiple %}
|
||||
<div class="field__items">
|
||||
|
||||
+6
-2
@@ -68,9 +68,13 @@
|
||||
{% else %}
|
||||
<div{{ attributes.addClass(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 }}
|
||||
</a>
|
||||
{% endif %}
|
||||
</div>
|
||||
{% if multiple %}
|
||||
<div class="field__items">
|
||||
|
||||
@@ -149,7 +149,7 @@ export default {
|
||||
}
|
||||
} else {
|
||||
// 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)
|
||||
|
||||
for (let i = 0; i < this.$router.options.routes.length; i++) {
|
||||
@@ -175,8 +175,9 @@ export default {
|
||||
}
|
||||
}
|
||||
},
|
||||
onClickFieldLabel(e){
|
||||
console.log("onClickFieldLabel", e, this.$router, this.$route)
|
||||
onClickFieldLabel(e, part){
|
||||
console.log("onClickFieldLabel", part, e, this.$router, this.$route)
|
||||
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
|
||||
Reference in New Issue
Block a user