New answers tagged

2 votes
Accepted

Field values in node HTML body

It sounds like you need to use tokens. Drupal core has token functionality built in but doesn't include fields. Have a look at this module it adds token support for fields https://drupal.org/project/...
1 vote

Use AJAX On Node Add Form To Change Field Required Status

Changes to the form must be made in the form definition, and cannot be made in the ajax callback, as Drupal has already cached the form by the point of the ajax callback, so even if you figured out a ...
  • 16.4k
0 votes

How can I embed a View inside a content of a node?

You can use https://www.drupal.org/project/views_entity_embed. It allows you to embed views in textarea using WYSIWYG editor.
2 votes
Accepted

Statistics counter based on user role

The statistics module adds a js library to the node build. You can remove it if you don't want to count the node: mymodule.module /** * Implements hook_ENTITY_TYPE_view_alter() for node entities. */ ...
  • 93.7k
0 votes

How to remove author field from the 'advanced' field group on the node edit form

This works... though it doesn't look quite right to me. function MYTHEME_form_node_form_alter(&$form, \Drupal\Core\Form\FormStateInterface $form_state, $form_id) { $form['author']=['#group'...
  • 193
1 vote

Limit the number of nodes per User

To limit users from adding more than one node for a specific content type, you can use the hook hook_form_alter() to alter the node form and disable the submit button if the user has already created a ...

Top 50 recent answers are included