Drupal 8 Theming - Part 04 - Blocks and Regions

preview_player
Показать описание
In this Drupal 8 Theming tutorial we are going to be looking at setting up Drupal regions and adding blocks of content to them.

Drupal 8 and all the other "Drupals" have something called regions, they are locations on your page where you can put pieces of content or functionality. You do that among other things by adding blocks to them.

Blocks are "containers" that contain some content or functionality in them. You can easily move them around the regions by just dragging them in Drupal administration. Pretty great stuff.

### Code used in this tutorial

Рекомендации по теме
Комментарии
Автор

this will be funny foot note but:
YAML need a space after ':'

mytewhy
Автор

Love your Drupal 8 Theming playlist so far! It's making those Drab Drupal 8 docs so irrelevant! (Especially since most of their theming docs are incomplete). Thank you so much!

danielpak
Автор

Thank you so much. Your video explained me the concept neatly and also it helped me to rectify an error :)

chintukarthi
Автор

The styling is not to be found in github in the link below. I added those scss files and gulped but nothing happened.

rasithaferdinando
Автор

Hi Ivan, great tutorials! Thanks for that.

I have a question. Around 12:00, does the twig 'if' expression checks whether there are any blocks in the 'page.sidebar' or 'page.sidebar' is defined in the template file? It looks like at first it checks if there is a region called 'page.sidebar_first' exists, if not show nothing.

inanyt
Автор

hello, can you explain: how create blocks in block ?.
In Drupal 7, we have mini panel for this work.
example: view content_1)+.section_2>(some view content_2).
thank you.

maximstrutinskuy
Автор

Ivan, thank you for the great job. I've followed the whole playlist and I still have something that I don't understand even by watching againg this episose : I don't get how to place the region in the page. I followed everything by my sidebar is not on the side and appear down after the content. Where to say explicitely where to place the region ? How to you get several region side to side ? mine appears always below the previous one ? Thanks

redegotrip
Автор

Thanks Ivan I'm enjoying the learn.
Getting this error now though even with your files. Its after adding the regions to the info file. Any idea whats gone wrong? Im now on drupal 8.2
Unable to parse You cannot define a mapping item when in a sequence in (line 25 of

peterheap
Автор

it is weird. The block showed up but all contents and blocks squeezed to
the top left side. there isn't any theming or change of the layout.

alexisteo
Автор

Hi Ivan I had no styling at all until I copy and pasted your style.css to replace mine - was that the correct thing to do? (mine had 3 lines of code - yours has 11 lines with line 9 having a considerable amount) Mine now looks like yours so all good
Q1 normally would I have to insert all my css styling into style.css -
Q2 Although layout-sidebar-first is on the right hand side of page but has css code is "float: left." How is that?

bruceclark
Автор

So everyone is just going to ignore the fact that left sidebar appears on the right

reactivicky