This forum is for assistance with theme development.

Theming software

I know this might be a silly question but is there some theming software for Drupal 8?

I know Artisteer 4.x but it does not support Drupal 8 very well and TemplateToaster is completely unsatisfying.

[solved] html.html.twig for contenttyp

hello,

i need a special html.html.twig for one of my contenttyps.

if i debugg twigtemplates (like here) i only find names for the file for node (html--node--nodeid.html.twig) but not for a contenttyp.

also in the twig theming conventions (like here) are no idea.

perhaps someone can help me understand, what filename will be good?

thanks.

stefan

How do I import a macro into a template?

Hello,

I created a macro that I want to use (hence import) into a template. I have looked at countless tutorials but none of them seem to help and my macro is not being imported.

This is my folder structure:

-/templates
  -/partials
    header.html.twig
  -/regions
    region--header.html.twig

I would like to import the 'header.html.twig' file (which contains the macro) into 'region--header.html.twig'.

This is the content of the 'header.html.twig' file (which I want to import):

Cannot compare twig field integer to 0, even if it is 0

I have an integer field that I am trying to get my template to display differently only if it contains "0". Though I cannot get it to output correctly.

{% if content.field_caves__max_level.0 != 0 %}
  {{ content.field_caves__max_level.0 }} Max
{% endif %}

I've tried numerous other combinations including

Edit view field with preprocess hook

I have the following drupal hook.

$variables['output'] before hook: 1111111

$variables['output'] after hook: (304)111-1111

$variables['output'] when view is rendered: 1111111

How to add page templates for content types in Drupal 8?

I'm using the "basic" skin

my type of content is called "apartments"

when a file is added page--apartamenty.html.twig it does not work this way.

I have drupal 8.7.3

I use this method and it does not work what I'm doing wrong?

https://befused.com/drupal/page-template-content-type

Pages

Subscribe with RSS Subscribe to RSS - Theme development