Skip to main content
Search type Search syntax
Tags [tag]
Exact "words here"
Author user:1234
user:me (yours)
Score score:3 (3+)
score:0 (none)
Answers answers:3 (3+)
answers:0 (none)
isaccepted:yes
hasaccepted:no
inquestion:1234
Views views:250
Code code:"if (foo != bar)"
Sections title:apples
body:"apples oranges"
URL url:"*.example.com"
Saves in:saves
Status closed:yes
duplicate:no
migrated:no
wiki:no
Types is:question
is:answer
Exclude -[tag]
-apples
For more details on advanced search visit our help page
Results tagged with
Search options answers only not deleted user 2800

Use it for questions about the queue of messages displayed to the client.

4 votes

How to redefine a message type for drupal_set_message?

The status is arbitrary, so: drupal_set_message('A message', 'custom_status'); Will produce <div class="messages custom_status">A message</div> Notice the "custom_status" class, which you can ta …
Clive's user avatar
  • 168k
1 vote
Accepted

How to add an error notice with jquery?

Drupal uses messages as the 'base' class for messages so this should work: jQuery('h1').prepend('<div class="messages error">Start</div>'); Note that you shouldn't escape double quotes inside a str …
Clive's user avatar
  • 168k
3 votes

Which hook for a warning message?

Traditionally that's what hook_requirements() is for Check installation requirements and do status reporting. Emphasis mine. It's how modules declare that they are missing a required Javascrip …
Clive's user avatar
  • 168k
6 votes
Accepted

Risks of developping your own theme from scratch?

if, in a theme developed from scratch, you forgot to provide the code for render some elements, are they going to stay hidden? Yes, of course - if you develop a theme and override core templates, …
Clive's user avatar
  • 168k
1 vote
Accepted

Showing a message for specific content type

$node->type is a reference to the node type config entity - it's not a string. You can use NodeInterface::getType() instead, e.g.: if ($view_mode == 'full' && $node->getType() == 'test_content') { …
Clive's user avatar
  • 168k