Still on Drupal 7? Security support for Drupal 7 ended on 5 January 2025. Please visit our Drupal 7 End of Life resources page to review all of your options.
Hi,
how can I configure a block to be visible for specific content types, and for specific pages?
On the block config page, Home -> Administration -> Structure -> Block layout, I can configure the visibility for "Content types" and "Pages" separately, but these two conditions seem to be combined by an AND (which, to my understanding, does not make much sense...). I need the conditions to be OR'ed, since the block should be visible for specific content types, as well as for specific pages.
When I use Node::load(10)->toArray() I see that my module thinks that the current language is English. I have the language key (fr) in the url and when I place \Drupal::languageManager()->getCurrentLanguage()->getId() in my code it says (fr). How can I get Node::load(10) to see the current language the user is using?
When I translate the content type into another language, all translations of the same page seem to have the same id to place into the load function.
Hello,
I want to change the theme for image-formatter.html.twig for a specific field. Then I created image-formatter--field-image.html.twig but it is not working.
Is it something doable? And what am I doing wrong?
I am developing a custom field with the correspondent formatter and widget.
Right now i am stucked because i need the element to have an ajax behavior, but in the ajax callback (which is called) i can't access the value of the fields via the form_state object, which obvious i need in order to decide the behavior of the response.
I am using Drupal version 8.1.1 and installed following modules for creating an event listing feature.
Calender
views_templates
I have created a new content type as "Events" and added a date field to it. When I try to create a view for this Event, it does not show the option "Add view from template". Should I install some other modules or configure some thing else in Drupal 8 for this?