Some people like to load blocks in drupal 7 like this
Some people like to load blocks in drupal 7 like this
If you used google pagespeed and got "Enable Text Compression" you will fix this with uncommenting this lines in your nginx.config (or adding them)
I was wondering how PHP gets compiled to OpCodes and how does that all work, there is a nice post that talks about OpCode caching in general (a bit outdated now) and also gives a good example of how php code is tokenized for OpCode https://support.cloud.en
Reading docs about drupal_add_js you might think you can add JS to header of html, but only thing you can choose is header or footer of your theme (as region), to add JS to header tag, you need to use
Just go here and check how to do that
https://modulesunraveled.com/blog/install-drush-7-and-8-and-automatical…
also for drupal 7 dont use drush 9 with drush launcher as it is useless and most of the useful functions you had are gone in drush 9.
In many online tutorials you will find just few lines like
server {
server_name www.example.com;
return 301 $scheme://example.com$request_uri;
}
but actually you need much more, you need to include SSL certificates, otherwise you will get message about insecure site so you should have this
In lots of places you will see how to use drupal_http_request with drupal_http_build_query used on data, which is fine if you want to build regular query data (like the ones you have in URLs when using GET) but if you want to send JSON, you shouldn't use that, instead you need json_encode function on data.
By default body field of a content type will not be shown among the fields to index, which is kind of strange but that is how it is as many other properties and fields of content are there by default.
Recently I started using history command a lot. Just to check what I have done. One thing missing by default is timestamp, I want to know when I did something so to do that you can do this
Not many devs use try catch in custom code, especially in drupal 7. Thing is that it can save you from bigger problems if you wrap your (bad) code into that block, so lets just make simple example how to use it.