For assistance with theme development.

STICKY: Theme development forum guidelines

The theme development forum was created to aid those who are developing themes for Drupal. This forum is not for issues you may be having with contrib themes. Issues with contrib themes should be placed in the issue queue of the theme in question. Please respect this.

If you you have drupal installed already and are seeking a theme, have a question about a specific theme and what it does or if it will fit your use case, please place your questions in the Post installation forum.

Twig debugging problem

Hello,

I've read that to activate twig debugging you have copy development.services.yml to the default directory, rename it to local.services.yml, remove: 

parameters:
  http.response.debug_cacheability_headers: true

and add:

parameters:
  twig.config:
    debug: true
    auto_reload: true
    cache: false

at the end of the file.

theme install preprocess

is there a function that allows to do something whenever a theme is installed?

for example, I want to generate a content whenever a theme is installed.

D8 block twig configuration

I want to show the D8-based blocks in the block.html.twig file with the <aside> html tag only. However, when I entered this special split file, I created a special branch file for each block area (eg region--sagblok.html.twig), block title and content css, html codes. Unfortunately, the block titles did not appear.

print screen: 

http://s541.photobucket.com/user/veli3350/media/Ekran%20Grnts%202018-02-...

Sorry for my English.

Theme Customize

Hi All,

Anyone of you here knows how to add meta description to my page?

Thanks,
Macpugon
 

Drupal 8 - sorting an array of nodes by custom field - uasort - ordering nodes - sortByWeight

I am trying to organise, an array called $nodes, by a field within the nodes called node_order.

$this->query = $this->query->condition($field, 'EXISTS')->sort($field, 'DESC');

But with no luck.

Now I am looking at:

uasort($nodes, ['Drupal\Component\Utility\SortArray', 'field_node_order.value', 'sortByWeightElement']);

Were can I set the Weight for these pages, as all the child pages are created using the same template type, so I need a way to assign weight to each node. 

Pages

Subscribe with RSS Subscribe to RSS - Theme development