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

Override views field template with rendered value of another field.

If I need override views field template with value of another field,

i write in 

views-view-field-VIEW-NAME--DISPLAY-NAME--FIELD-NAME.html.twig

this code:

{{ view.field.ANOTHER-FIELD-NAME.original_value }}

It's works, but what if another field have option
Override the output of this field with custom text.
 

How to get this custom text in 
views-view-field-VIEW-NAME--DISPLAY-NAME--FIELD-NAME.html.twig
?

Change hook_schema to another database connectiom

Hi have two databases and i cant use the second one when i use hook_schema in my install file:

Custom fields on admin product page - Drupal 7

I'm new on Drupal.

I have successfully added several fields to the product page in the admin panel, but I cannot save the values ​​to use them in the future. What do I need to do?

$form_state->getFormObject()->getEntity() does not work in Drupal 7, similarly to $form_state->setValue() and $form_state->getValue().

What should I add to the code for this to work? How i can save values from this select fields?

Drupal Cache Issue

I want to get the cache object  but i am getting below error. Any help would be appreciated. I have this code in the core\lib\Drupal\Core\Database\Database.php

Code:

\Drupal::cache() ;

Error:

Drupal\Core\DependencyInjection\ContainerNotInitializedException: \Drupal::$container is not initialized yet. \Drupal::setContainer()  

Inject CacheBackendInterface interface in a class to make use of cache

Below is my class and i am trying to inject CacheBackendInterface interface in my class but it is not working. any help please?

<?php

namespace Drupal\Core\Database;

use GuzzleHttp\Client;
use GuzzleHttp\Exception\RequestException;
use Aws\SecretsManager\SecretsManagerClient;
use Drupal\Core\Cache\BackendChain;
use Drupal\Core\Cache\MemoryBackend;

Modal dialog: (adding extra button to close)

I have created a page and added views block and listing articles from a specific content type. I added a global: Custom text field and added a link that successfully opens a modal_dialog window with the code below.

<a class="use-ajax button" data-dialog-type="modal" href="node/{{ nid }}">open modal</a>

Pages

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