This forum is for assistance with theme development.

[Solved] Drupal 8 Twig debugging: no handy comments

OK, I've clearly missed someting here.

I've got D8.05 running, and have subthemed Bootstrap.

I'm trying to turn on Twig debugging, to no avail. (I just want to move my h1.page-title).

I've copied default.services.yml to services.yml in my sites/default; I've set debug: true and auto_reload: true in sites/default/services.yml.
I've also created settings.local.php and uncommented the render cache and dynamic page cache there.
I created sites/default/development.services.yml by copying sites/development.services.yml.

Drupal 8 theming a view advice

Hi,
I'm very new to Drupal and I’m experimenting theming in Drupal 8. I want to have a certain view on the frontpage as a block. The block has some kind of table with an image and a clickable title of a certain contenttype. Creating this is not really difficult, I already created this, but I want something like this:

The first row:
title | image | title | image | title | image

but now the second row should be
image | title | image | title | image | title

in total that gives:

$variables is cached...

In relation to this, now resolved, issue (thanks again Jeff!):

https://www.drupal.org/node/2679086

Ok, so in MY_THEME.theme I have:

function MY_THEME_preprocess_menu(&$variables) {
  $variables['MY_THEME_path'] = \Drupal::request()->getPathInfo();
}

so that in my menus I can see what page I'm on and style the links accordingly.

Dropdown Main menu

Sorry, but English is not my native language.
Therefore, some descriptions of functions cause me some confusion. Especially if they are "scattered" in different parts of the documentation, forums, questions ... And provide partial answers.
Although ... Maybe it's just a "problem" of translation?

Resolved: Taxonomy image with language specific link

Scenario

On a multilingual site, I need to show a list of vocabulary terms, not in text but all terms replaced by their respective image links.

What's the URI of the page I'm on?

I'm sure there's a very simple answer to this, but I need to determine the URL, URI, whatever, of the page that this template is currently executing on.

When I try to see what's in the Twig global variable "app" I get NULL. When I try to see what's in the variable "parent" I get NULL.

Thank you.

Pages

Subscribe with RSS Subscribe to RSS - Theme development