Default new book in dropdown book module


First of all sorry for my english, my native language is spanish.

Ok, does anyone know if it's possible to set by default the option "new book" into the dropdown of the "index book" of the book module? But just if you want to create a new book, not if you want to add a child page for an existed book 

Thanks a lot.

How do I get content type (node) data in a Custom module?

I tried doing:

use \Drupal\Core\Entity\EntityInterface;
use \Drupal\Core\Entity\Query\EntityQueryInterface;

use Drupal\node\Entity\Node;
use Drupal\field\FieldConfigInterface;

$query = \Drupal::entityQuery('api_detail')
    ->condition('status', 1);
$nids = $query->execute();
$node = Node::node($nids);

But, when I load the page, it prompts an error:

"The website encountered an unexpected error. Please try again later."

Can anyone please help?


Colorbox Question


I have a live site and a dev site.

On the dev site I am adding a second language (Espanol). For the most part all is working great basically.

But I noticed on a translated image carousel, when I click on an image - a color box image comes up by design.

While there SHOULD be only 1 image -  the color box navigation is showing "1 of 2" and "2 of 2" and the color box arrows.

For an example of the navigation - see this image:

How do i change the "My account" page

Semi-Newbie here.

How do I change the my account page to make it into a dashboard or profile of the sort?

I tried google and a forum search but i cant find anything in related in Drupal 8.

I want to display things like Profile pic and user information.

I just cant seem to figure a way out. If I need a module that is fine.

Also ps question; How do i change the registration page as well

Thank you!

How can I get the content_moderation_state of last revision (draft, published) in node.twig

I have user created content. I use the content-moderation plugin, so a user can update his nodes but the update will only be published after moderation from an editor. I like to display a little batch (has new unpublished version) for the user on his nodes, to give him an information about the moderation state.

I know, I can get a moderation state via $node->moderation_state->value; in preprocess_node_function. But this value ignores the last unmoderated revision and says always "published",

Programmatically duplicating a webform (Drupal 8.5.2)


Drupal 8 allows you to duplicate a webform from the admin interface, which is great, but is there a way to do this programmatically? I can't seem to find any posts regarding this on the forums. I suspect there's a function to do this hidden somewhere.

Any help would be greatly appreciated!


Subscribe with RSS Subscribe to RSS - Drupal 8.x