Drupal 8 and preprocess node

I am trying create module, which check every nodes (type "article")  and replace some string - for example external url to something what I wish. My problem is, that print_r or var_dump after node_load is too big and I get error Allowed memory size of 805306368 bytes exhausted.

I created something like this:

function mymodules_preprocess_node(&$variables) {

$node = $variables['content'];

}

Driving global change with World Vision International

child laughing

Third and Grove worked with World Vision to build brand awareness, credibility, and most importantly, increase donations by 23% in under 3 months

World Vision International is on a mission to pull every child out of poverty. We’re building a global digital brand to help make that happen.

Sectors: 
Non-profit

Error while trying to upload a module

Hello!

I get  "Drupal\Component\Plugin\Exception\PluginNotFoundException: The "entity:file:undefined" plugin does not exist. Valid plugin IDs for Drupal\Core\TypedData\TypedDataManager are ... Drupal\Core\Plugin\DefaultPluginManager->doGetDefinition() (line 53 of core/lib/Drupal/Component/Plugin/Discovery/DiscoveryTrait.php)"

So, I cannot upload any new module. Any ideas how to solve this?

How to display 'Sort by' filter dropdown in results section?

I have a search page that has filters on the left bar and results on the right. I want to display the 'Sort by' drop down on top of the 'Results' section. I have a custom template for the results section alone -> views-view-fields--search.html.twig. Not sure how to add the 'Sort by' drop down in this file. Any help?!

Linking a custom page to an image using Views

Hi,

I have created a page using Drupal views. And I have displayed the logo field in the view settings, like this:

https://imgur.com/a/5Ywpyi0

I want to click on the image displayed, so that it takes me to a custom page. The url for the custom page has a dynamic variable : /text/{textid}/content. textid is the node id for the content.

I am trying to add the link to this image using the following settings:

https://imgur.com/a/b9L1hg7

Layout Builder data via JSON:API

I'm working on a decoupled Drupal with a Gatsby frontend. The challenge I'm currently facing is reading data from page layouts, this doesn't appear to be exposed by JSON:API. I want to create a flexible block based page building experience that I can handle on the frontend. Is this possible?

Pages

Subscribe with RSS Subscribe to RSS - Drupal 8.x