Configure Block visibility for Content types and Pages in Drupal 8

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.

How do I get my module to detect current language?

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.

D8 PODCASTING SOLUTIONs anything yet?

I was just looking for a DRUPAL 8 AUDIO solution for a content type. Just something with a play button... somekind of MP3 player?

I tried to get
https://www.drupal.org/project/audiofield
to work but no joy. Its not D8 ready yet.

I am curious how difficult it would be to do
https://www.drupal.org/project/audio_js
in D8 or if there is something similar coming up.
thanks

image formatter for specific field

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?

Thanks a lot

Drupal 8 Field Widget Ajax

Good morning,

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.

Here goes the example:

Add view from template in Drupal 8

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?

Please advice.

Pages

Subscribe with RSS Subscribe to RSS - Drupal 8.x