This forum is for module development and code related questions, not general module support. For general support, use the Post installation forum.

How to add multiple <meta> tags to <head> via render array.

Hello friends,

I am able to add a single <meta> tag to the <head> tag of my page via a render array  in my pages controller, using the following code:

Module to request Web API: need help

I've used Drupal 8 using twig mostly.   Now I need to add this functionality to the website.

1) Using a html form, submit a query for a location (zip or address)

2) Taking the input, send a Web API query in PHP using curl to return a JSON list of branches near this geopoint.    The API query needs to happen on the backend.

3) Using the JSON in javascript, parse the results.

Implementing hook_entity_presave

Hi,

I want to set a field value in a content type using hook_entity_presave. Please let me know how can I set the field value.

Currently I am using $entity->set("field_myfield","some value") , but it wont work.

Implementing hook_entity_update

I am trying to update a content type source_node using hook_entity_update as follows: I am getting an error for using $entity->getType() == 'source_node'

I have tried using $entity->getEntityType() == 'source_node' but it is not updating correctly.

function heritage_schema_entity_update(Drupal\Core\Entity\EntityInterface $entity) {

How to update multiple entities at once

Hi,

Let's say I create a field X for a taxonomy term , I want to update multiple terms's field X at once,  Is it possible? 

Syntax Entity reference

Hi, I'm trying to create an open source tool for the comunity and struggling on a technical point in relation with entities.

Pages

Subscribe with RSS Subscribe to RSS - Module development and code questions