Answer the question
In order to leave comments, you need to log in
How to exclude a block from a page using a mixin?
Let's say there is a main.jade page that has a header block in which the block is connected
+header-presentation(data)
+header-presentation(data)?
"header": {
"main": {
"header-presentation": true
}
}
mixin header(data)
header.header
.header__top
.header__bottom
.header__inner
+header-presentation(data)
Answer the question
In order to leave comments, you need to log in
I use jade for layout. Here is an example of how I would solve the problem of disabling the block in the header depending on the page.
layout/_default.jade
include ../mixins/_mixins
doctype html
html(lang="ru-RU" class="no-js")
include ../parts/_head
body
.wrapper#wrapper
block header
include ../parts/_header
.content#content
block content
block footer
include ../parts/_footer
header.header
.header__top
.header__bottom
.header__inner
if (headerPresentation)
+header-presentation(data)
extends layouts/_default
block head
- pageTitle = 'Title';
block header
- headerPresentation = false;
block content
block footer
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question