This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /** | |
| * Implements hook_node_presave(). | |
| */ | |
| function custom_node_presave($node) { | |
| // Get the source of the "base" path which has subpages. | |
| $source = 'node/' . $node->nid; | |
| // If the node's alias is "foo", foo/edit will be an alias for node/123/edit. | |
| custom_save_subpage_alias($source, 'edit'); | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // ID of taxonomy term to remove. | |
| $tid = 5; | |
| // Name of the taxonomy field where the term is found. | |
| $field_name = 'field_NAME'; | |
| _taxonomy_term_remove_from_nodes($tid, $field_name); | |
| function _taxonomy_term_remove_from_nodes($tid, $field_name) { | |
| $nids = taxonomy_select_nodes($tid, FALSE, FALSE); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Configure colors, if available. | |
| if [ -x /usr/bin/tput ] && tput setaf 1 >&/dev/null; then | |
| c_reset='\[\e[0m\]' | |
| c_user='\[\033[1;33m\]' | |
| c_path='\[\e[0;33m\]' | |
| c_git_clean='\[\e[0;36m\]' | |
| c_git_dirty='\[\e[0;35m\]' | |
| else | |
| c_reset= | |
| c_user= |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| server { | |
| server_name foo; | |
| listen 80; | |
| error_log /var/log/nginx/foo.error; | |
| access_log /var/log/nginx/foo.access main; | |
| root /srv/www; | |
| location ~* \.(png|jpg|jpeg|gif|ico)$ { # TODO Add CSS and JS to the mix for production |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Vagrant::Config.run do |config| | |
| (…) | |
| # Share project folder through NFS. | |
| config.vm.share_folder("v-root", "/vagrant", ".", :nfs => true) | |
| # Provisioning. | |
| config.vm.provision :chef_solo do |chef| | |
| chef.cookbooks_path = "cookbooks" |
NewerOlder