webmonkeying
What to do when .gitignore doesn't
Wednesday, 12 October 2011 @ 10:32am
So. At work we’ve switched from using svn to git (and GitHub).
Difference: decentralised, therefore “commit” commits it to the local repo rather than the remote/centralised one, and you have to “commit” then “push” to the remote.
Problem: .gitignore was not gitignoring some files (settings.php and .htaccess which I had to change to make it work on my local) which it was supposed to be gitignoring.
Solution as per RobWilkerson.org:
Do: git status which should spit up a list of modified files since lasy commit/sync/something (shut up I’m still working git out ;)
Thoughts on DiSo
Tuesday, 4 October 2011 @ 11:34am
I’ve had several.
Simultaneously, I’ve had several thoughts on which way this post was going to go. Originally I was going to go along the vein of a blog post from Zauber Paracelsus (which outlines the “nymwars” debacle to the date of that post, people embarking on “Project DeGooglefy” and alternatives to Google services).
Then I was going to do something or other about G+ and Facebook and problems with centralised social networks.
Drupal 7 notes: unsetting formatting tips
Monday, 29 August 2011 @ 1:22pm
Following on from hiding unwanted elements in comment forms, I found this tip on one of the many threads in Drupal of people trying to hide the pesky formatting guidelines and came up with:
template.php
<?php function [theme_name]_form_comment_form_alter(&$form, &$form_state, $form_id) { $form['comment_body']['#after_build'][] = 'remove_tips'; } function remove_tips(&$form) { unset($form['und'][0]['format']['guidelines']); unset($form['und'][0]['format']['help']); return $form; } ?> That gets rid of everything but the fieldset container and for the roles that can use multiple text formats, the select box (the “Text format” label can be easily removed with $form['und'][0]['format']['format']['#title'] = ''; in the comment_form_alter).
You're doing it wrong
Monday, 22 August 2011 @ 2:30pm
Here was supposed to be yet another whingepost about how I’m doing everything wrong and there is now nothing that I “can” drop. So I’m going to see if I can somehow write myself into doing “it” right.
The computer room is a f***ing mess There is more crap than there should be on the desk. Most of it is paper that needs to be filed or recycled, and I have just been too damn lazy to process them into the appropriate location.
Drupal 7 notes: node--[type].tpl.php being ignored
Friday, 24 June 2011 @ 9:20pm
If you change the machine name of a content type, make sure you bump all the nodes that were created under the old machine name. If that doesn’t work or there are too many of them, change them in the database.
In the below example I was trying to theme the “estimate” nodes with node–estimate.tpl.php. It wasn’t working because node 1 in this case still had the original type of “screen”.
Drupal 7 notes: the submit button on the node creation form isn't working!
Thursday, 23 June 2011 @ 1:44pm
In template.php:
<?php function [theme-name]_theme($existing, $type, $theme, $path) { return array ( '[content-type]_node_form' = array( 'render element' => 'form', 'template' => 'node--[content-type]-form', ) ); } ?> If you keep template files in a subdirectory (eg sites//all/themes/[theme-name]/templates or something to that effect) this may help:
'path' => drupal_get_path('theme', '[theme-name]') . '/subfolder', After you’ve put all your fields where you want them in your pretty node--type.tpl.php:
<?php echo render($form['title']); echo render($form['field_[field_name]']); // etc // with whatever formatting around it ?> At the end put
Drupal 7 notes: unserialize() and undefined index notices after importing users from a csv
Tuesday, 24 May 2011 @ 10:31pm
Long title is going to break my pretty layout.
So following on from the task of having to import a csv file of users into Drupal 6, I upgraded that install of Drupal 6 to 7, then exported the users, user roles and role tables into csv files for insertion into the database at work. Of course I had to test it out on my local to make sure nothing was too broken.
Drupal 6 notes: dealing with a users.csv file
Thursday, 19 May 2011 @ 11:02pm
Think I’m one of the few people on the planet who could have trouble with something as basic as this.
Problem: csv dump of the users table will not import no matter how you tweak the settings.
Solution:
open csv file in NeoOffice (or whatever your spreadsheet thingi of choice is). I had to edit mine to change the user1 in the csv to uid 2 as there is already a user1 in the D7 it will be going into, other people may not need to edit theirs save the file, and keep it in csv format rather than changing to the native format of the spreadsheet using phpmyadmin, go to the database and find the users table, and select import browse for the csv file, leave all settings as they are, press go In my case running the thing through NeoOffice stuck semi-colons all over the place which apparently made it easier for phpmyadmin (or MySQL, not sure which) to deal with. User table inserted.
Work, Wannabe and other projects and a dash of unschooling
Friday, 22 April 2011 @ 11:38pm
[minor pseudonymising edits during Drupal to hugo migration for all the good that will do now]
Firstly, what in the hell is with the life category?! I’ve been (very slowly!) importing livejournal entries so I can replace missing photos. Very minor regret that I didn’t bother skimming through my shadowshifter livejournal before I deleted it as I probably had a few progress reports for my various projects kicking around on it, but oh well.
Drupal 7 notes - putting submenus in different places from the parent menu while keeping your active-trail
Sunday, 6 March 2011 @ 11:12am
By default, when you set up a child menu, it appears directly under and slightly indented from the parent item. Occasionally, there is a need (such as with the kiosk I’m currently working on for the Christmas Island Tourism Association) where you need an active-trail but the menus need to be in different regions.
Rather trying to do everything with blocks in regions I found it easier to dump code in templates.