This forum is for assistance with theme development.

Date format inside TWIG

Hey all, I have a date field with a start and end date.  I have a complex set of rules that I use to display this field, based on what the dates are.  I have a custom twig template to handle this, but I'm having a little difficulty formatting the date in the way I want to.  What I want to do is take whatever format from the "Manage Display" form and use that inside my twig template.  This way I'm not manually adding PHP date formats in the template themselves, so if the client wants the date format to be different, there is no code push.

How to display custom category content on Taxonomy page Drupal 8

I want to show category content on page--taxonomy.html.twig page.

Currently i am using this {{ page['#content'] }} to show the content of category.

Problem attaching a library using hook_name suggestions

Hello,

I'm new in drupal 8 world and I'm trying to make my first steps in theming.

Because I want to use different libraries to different pages I realized that I cannot attach libraries If I use hook_name_suggestions.

In my node.html.twig I'm attaching a library as normal:

{{ attach_library('anitas/node_styles') }}

but If I use hook_name_suggestions like html--node--1.html.twig

and in the new content insert

{{ attach_library('anitas/node_1_styles') }}

Custom theme works in DEV, but not in PROD

I have a custom Drupal (8) theme I have been putting together from scratch, and 2 CentOS web servers built to be as identical as possible.

Part way finished, I copied the theme I was working on in DEV onto PROD so the stakeholder could look at its progress.  It worked alright, though it was not finished.

I continued to build the theme on the DEV box and am trying to apply it to the PROD server.

Altering output header colors Drupal 7 Views 3 - Edit view or change theme?

In an old Drupal website, we used the Marinelli theme and a site specific subtheme.  We created multiple Views in the old website, and the client wants to use them in the new website.

The Headers in my old website View output have light blue backgrounds.  For a new website that is based on the old one, I want the Headers in my View output to have light green backgrounds.

Twig access parent fields in a paragraph template

I know I can get reference entity fields, in a Twig template, using something like:

{{ node.ref_field_name.entity.field_name.value }}

but, is there a way to access the fields of the a referencing parent entity? 

Pages

Subscribe with RSS Subscribe to RSS - Theme development