arnoldbird
  • Member for 9 years, 7 months
  • Last seen more than a month ago
How can I change the page title?
6 votes

Change the title tag in the head of your HTML document. function mymodule_preprocess_html(&$variables) { $variables['head_title']['title'] = $something; } Change the title that appears in the ...

View answer
custom user page image field crashes when uploading, removing image
Accepted answer
6 votes

In the menu entry for your custom page, if you have not already done so, you need to add the file path and file to reference the user module files, like so... $items['my/custom/page'] = array( '...

View answer
How to add print stylesheets
Accepted answer
4 votes

If it is correct, should I also include print media queries in the print.css file? It's correct, and there's no need for media queries in the CSS file. (Separately, I'm still trying to determine ...

View answer
Can't install drush with composer
Accepted answer
4 votes

The solution in my case was to run... composer global update composer global require drush/drush:dev-master Previously, I had been running composer update but needed to run composer global update.

View answer
Can't update core with composer: "Your requirements could not be resolved to an installable set of packages"
2 votes

The solution in my case was to delete the vendor directory and delete composer.lock. I am not totally sure I needed to delete the vendor directory, because I tried that first without deleting ...

View answer
How to Display a Block on a Page with a Variable URL
Accepted answer
2 votes

I'm not sure what you mean by the PHP box. You could do this with the block's visibility settings. For example, if you wanted to show the "Powered by Drupal" block on only the URLs you mentioned, ...

View answer
Why doesn't hook_preprocess_block() alter the block content?
Accepted answer
1 votes

There were two issues, in my case. For one thing, I was using the wrong key. I needed to use... $variables['content']['body'][0]['#text'] ...instead of... $variables['elements']['content']['body'...

View answer
Composer doesn't see that updates are needed
1 votes

Update: This is not a good answer. Leaving it here for reference, but this does not solve the underlying problem, whatever it is. Fixed by deleting vendor and core directories and composer.lock and ...

View answer
How can I programmaticaly submit the user edit form in Drupal 8?
Accepted answer
1 votes

I was mistaken when I said "auth_user_id" is always zero. It isn't. It contains the user's ID, as you would expect. That makes this task fairly simple. Here is the function for my logout endpoint: ...

View answer
Comment form won't appear in my theme
Accepted answer
1 votes

The "Comments block" module was the cause of this. The module appears to be functioning as intended. I just hadn't encountered this contributed module before, and didn't realize the project made use ...

View answer
Drupal Commerce Need Function To Retrieve Customer Profile Fields From Commerce Order
1 votes

If you have the $order object, then... $profile_id = $order->commerce_customer_billing[LANGUAGE_NONE][0]['profile_id'];

View answer
Why is libraries-override not removing assets?
0 votes

This doesn't answer the original question, but turns out to be a better solution in my case. You must clear your cache with each change to this function: /** * Implements hook_library_info_alter(). ...

View answer
Is there a way to generate dummy content for custom entities?
0 votes

To create some demo entities programmatically, you can use a while loop in your function. To create 100 entities: $i = 1; while ($i <= 100) { $i++; // Create an entity here. See https://www....

View answer
How do I index all the content with the search_api module?
Accepted answer
0 votes

You must click the "Queue all items for reindexing" link that appears below the "Start Indexing Now" fieldset, and then once you run that process, you can return to the index UI (example.com/admin/...

View answer
Altering block to include another block
0 votes

There are multiple ways you could approach this. Rather than create a new block, one way would be to add the 'change_link' item to the User Account menu, and then use hook_link_alter to add the ...

View answer
solr is running, but search isn't working: "The Solr server of Solr could not be reached."
-1 votes

I'm not sure what caused the problem in the first place, but it was ultimately resolved by running solr with a different user. In trying to address the original problem (whatever it was), I ran solr ...

View answer