- Drupal Theme Cookbook
- Quick Drupal
- Theme development
- Tempalte Settings and hook
- Get theme path
- Include files
- Get theme info function
- Unset drupal system or modules Js - Must be required Get Info Function
- Unset drupal system or modules CSS - Must be required Get Info Function
- Override Drupal Default Print
- Hide/Change First Time With Front Page
- Region template by UI
- Block template by UI
- Tools
- SSH Command Used
- Git Command Used
- [Drush]
- Drush Install - A command line shell and Unix scripting interface for Drupal
- Drush Commands - Drupal6, Drupal7, Drupal8
- Drush Drupal Quickup - Drush map
- Drush Command Used
Quick install Drupal, Themes, Modules, libraries
https://www.drupal.org/project/drupal
$ drush(#drush) dl drupal
$ mv drupal... siteName
$ cp siteName/sites/default/default.settings.php siteName/sites/default/settings.php
$ mysql -udbuser -pdbpassword
$ mysql> create database sitedb
$ mkdir files
# Apache need write (chmod a+w files)
# Open in the browser
$ cp example.sites.php site.php
$ vim sites.php
# $sites['drupal7.wenroo.com'] = 'example.com';
$ cp siteName/sites/default siteName/sites/example.com
$ cp siteName/sites/example.com/defaule.settings.php siteName/sites/example.com/settings.php
# Theme Database
$databases = array (
'default' =>
array (
'default' =>
array (
'database' => '',
'username' => '',
'password' => '',
'host' => '',
'port' => '',
'driver' => 'mysql',
'prefix' => '',
),
),
);
# Theme Debug (More suitable on drupal 8)
# $conf['theme_debug'] = TRUE;
# m.site.com use mobi theme
# $http_host = explode('.', $_SERVER['HTTP_HOST']);
# if ($http_host[0] == 'm') {
# $conf['site_name'] = 'mobile site';
# $conf['theme_default'] = 'mobile';
# }
Use Editor, compiler tools, management tools, auxiliary tools to effectively handle the responsibilities
#Search
grep -r 'wenroo' modules/
git clone
git pull
git status #check
git add file
git commit -m ''
git push
#add and commit
git commit -am ''
# merge self
git fetch origin branch
# merge auto
git pull origin branch
# merge one by one conflict
git rebase
# merge finsh conflict
git merge
# Cancel local changes
git checkout filename
# Graphical management 图形化管理工具
git gui #https://git-scm.com/docs/git-gui
# Checkout new branch and don't need commint
git stash #Save
git stash list #view
git stash pop #merge
git stash clear #remove
# change user info
git config --global user.name username
git config --global user.mail [email protected]
# ignore files
vi .gitignore #Current
vim ~/.gitconfig #Global
# local sources #本地源
git remote -v #View
git remote set-url origin [email protected]:wenroo/drupal-theme-cookbook.git #edit
# Svn to Git
git svn clone -s http://..... #Clone
git svn rebase #pull
git svn dcommit #Push
#Export database
drush sql-dump > ./db.sql
#Export gzip database
# mysqldump -p site > db.sql
drush sql-dump > db.sql —gzip —result=/backups/example.sql
# —destination=/backups/example.tar
# Import database From settings.php
drush sql‐cli < db.sql
# Clear datebase
drush sql-drop
# Clear cache
drush cc all
# Login Once
drush uli
# Change password
drush upwd root --password="****"
# 用户登录超过5次锁定解除
drush sqlq "DELETE FROM flood"
# Overall backup
drush ard
drush arr
--db-url=mysql://root:***@localhost/Site site.tar.gz
# Make Download
drush make --no-core file.make.yml ../../
# Revert Features
drush features-revert-all