Error in getting the title of a form using $form_state->getValue()

Hi,

I have written a custom function, where I need the title of the form. I am using the following to get the title:

$title = $form_state->getValue('title');

But it returns an array. I need a value like 1.1 (the title of the form is 1.1).

I need the title of the form to do a database query, something like this:

db_query('SELECT title FROM `node_field_data` WHERE title = :title AND langcode = :langcode',[':title' => $title,':langcode' => 'en'])->fetchField();

Rewriting the results of a video does not work.

I am running Drupal 8.7.8 

I've created a view, and needed to rewrite the results of all my fields. Everything works fine except the {{ field_video }} field. It is an mp4 video file field. 

I don't see any reason why it wouldn't output a video file. 

Suggestions?

Accessing parent block label from menu.html.twig

Scenario: I have a custom menu, full of links defined by an end user.

It's inside a custom block, also defined by an end user.

The block has a title the user picked.

I need to have a variable in menu.html.twig that contains the title of the block, as picked by the user.

So, if Sally creates a block named "Avast!" and then places a menu inside it full of links to pirate-themed web sites, I want to be able to put something like {{ block_name }} into menu.html.twig, and have it result in the phrase "Avast!"

How to add this Prev/Next article views?

Hi there. I want to add in my site the arrows that displays in this theme: http://senseb.drupalet.com/content/sociis-arcu-commodo

I tried Flippy module but it only adds the title and link, and I want to display this information in a more elegant way.

Thanks for your time.

uploading PDF files on Drupal 8

I am trying to make a content type where I plan to upload various PDF files about various topics of interest.  People could freely download these pdf files just by clicking on the file name or the PDF image of that file once they are on the node page in question.  Could anyone please guide me on which path to take to make that  kind of content type?

Thanks and regards

Pages

Subscribe with RSS Subscribe to RSS - Drupal 8.x