This forum is for assistance with theme development.

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.

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. 

Render preprocessor function HTML in page

In creating a custom theme I lost the edit page link admins see when they login and created this code:

// get node ID...
    function nosurprise_preprocess_html(&$variables) {
    $nid = $variables['result']['node']->nid;
    $node = node_load($nid);
  
  if(node_access('update',$node)){ print '<span style="font-size:12px;">'; print l( t('Edit Page'),'node/'.$node->nid.'/edit' ); print "</span>"; }
    }

How do I render the html produced by this line: 

This Theme

Hi,

I am looking for a theme looking more or less like this : https://imaginary.org/

Looks pretty simple but I don't know if such a theme already exists, so that I could only chage a couple of things.

Thanks,

-Fred

D8 - image url not working in subfolder in footer

I'm facing a problem with image url path in theme. base_path doesn't give the same url depending on the page and the area in the page. Why?

Pages

Subscribe with RSS Subscribe to RSS - Theme development