Skip to content

Instantly share code, notes, and snippets.

@raphaellarrinaga
raphaellarrinaga / drupal_7_php_cheat.md
Last active Jul 1, 2020
[Drupal 7 php/config cheatsheet] #tags: drupal7, php, cheatsheet, config
View drupal_7_php_cheat.md

Drupal 7 PHP cheatsheet

Get the NID of the current node

Assuming your code is running for a node page, the methods I see used most often in core/contrib modules are either using menu_get_object() or arg():

if ($node = menu_get_object()) {
  // Get the nid
  $nid = $node->nid;
View lando_helpers.md
@raphaellarrinaga
raphaellarrinaga / admin_sys.md
Last active Mar 26, 2020
Bash & admin sys commands
View admin_sys.md
@raphaellarrinaga
raphaellarrinaga / settings.php
Last active Dec 5, 2018
Drupal 8 development settings file
View settings.php
<?php
/**
* @file
* Drupal site-specific configuration file.
*
* IMPORTANT NOTE:
* This file may have been set to read-only by the Drupal installation program.
* If you make changes to this file, be sure to protect it again after making
* your modifications. Failure to remove write permissions to this file is a
@raphaellarrinaga
raphaellarrinaga / worpress_install.md
Last active Feb 17, 2018
Wordpress ressources for a VM + composer installation & notes
View worpress_install.md
@raphaellarrinaga
raphaellarrinaga / git_cheatsheet.md
Last active Jul 16, 2020
[GIT cheatsheet] #tags: git, cheatsheet
View git_cheatsheet.md
@raphaellarrinaga
raphaellarrinaga / drupal_install.md
Last active Oct 6, 2021
[Drupal install & config process from scratch] #tags: drupal, drupal8, config
View drupal_install.md

// Update 2021

composer create-project drupal/recommended-project myproject -n or

composer create-project drupal/recommended-project:^8.9 myproject -n

cd myproject
lando init --source cwd --recipe drupal8 --webroot web --name myproject
lando start
@raphaellarrinaga
raphaellarrinaga / xdebug_config.md
Last active Feb 17, 2018
Some option to configure xdebug with sublime, drupalvm
View xdebug_config.md