This forum is for assistance with theme development.

hide editable field to everyone but editor

Hi,

I am trying to hide a field 'field_company_notice' for all roles except the 'Editor' role from being able to add/edit this field.   I know I could use 'Field Permissions module but I only need this for 1 field (same field for 5 content types).

In my administrator theme  .theme Drupal 9 file I added:

Circular chart module doesn't work on Bootstrap Sub-theme in Drupal7

I used "circular_chart-7.x-1.0" module on Drupal 7.82.

The circular chart works very well on Bartik theme, Bootstrap 7.x-3.15 theme and built-in theme of Drupal7 but it doesn't work in Drupal Bootstrap sub-theme. [.circles-wrp and .circles-text class doesn't display on node page and view block).

How can I solve this problem. Please help me. Thank you.

SOLVED : Trying to have a sub-theme from Belgrade (D 9.2.4)

Hi everyone,

I'm using the Drupal version 9.2.4

I try to create a sub-theme from Belgrade 8.x-1.1.

So I installed Bootstrap3 and bootstrap3_commerce then Belgrade and then my sub-theme.

my sub_theme works but my css file is not used, I read everything i can find on this subject but it changes nothing.

Here is my info.yml

{{ foo }} variable in twig not outputting anything even-though {{ dd(foo) }} shows the value is set

I have a views tpl where I set a variable but nomatter what I do, I can't get the output as a string ... even-though the drupal dump is indicating the value is set before AND after the output.

{% set foo = 'bar' %}
{{ dd(foo) }}
{{ foo }}
{{ dd(foo) }}
this is driving me absolutely nuts ... been looking at this for over an hour

Override a template for a specific content type in Drupal 8

I added a new content type naming 'Custom Page'. I want to create a new template for all of the content with the content type 'Custom Page'.

I added the below code into my custom.theme file:

function yan_theme_suggestions_page_alter(array &$suggestions, array $variables) {
  if ($node = \Drupal::routeMatch()->getParameter('node')) {
    $suggestions[] = 'page__' . $node->bundle();
}

I understand that it needs to create a file xxx.html.twig in theme/custom/templates, right?

Main menu override defualt name suggestion in Twig

Im using {{ drupal_menu('main', 1, 5, TRUE) }} to render main menu inside an individual template, and only suggests menu--main.html.twig and menu.html.twig

Pages

Subscribe with RSS Subscribe to RSS - Theme development