technonaturalist

image link to hive image link to ko-fi

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

World has problems. Quit the rhetoric and fix it.

Monday, 20 June 2011 @ 4:09pm

[minor pseudonymising edits during Drupal to hugo migration for all the good that will do now]

[I was leeching a bunch of images which have since vanished]

What I love best about my current job is the inclination of the supervisor to tend towards wanting to “get shit done”. As with all large projects (and it is a decent sized Drupal project we’re working on), you want to plan it as best you can to try to minimise stuff-ups and associated explosions down the track.

Wacky wednesday

Thursday, 16 June 2011 @ 9:50pm

[minor pseudonymising edits during Drupal to hugo migration for all the good that will do now]

Yesterday, it seemed like it was going to rain just enough to be annoying for walking to the shops down the road (but not for the dams, more rain is good for dams), so I decided to drive to Carousel and let the kids have a play at the playground before grabbing snacks and doing the top up shopping.

Reading and writing

Friday, 3 June 2011 @ 11:27pm

[minor pseudonymising edits during Drupal to hugo migration for all the good that will do now]

2yo loves being read to, and is constantly bringing books to us and demanding “Wead book!”

Happy toddler with a book

I can also say “duduk” to him and he will sit down. All three kids understand “makan” and “bagus” (6yo used to pronounce it “ba-goo-doos” when he was 2yo’s age :) and that’s as far as I’ve gotten with Malay; my vocabulary is shocking and grammar non-existant.

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.

Lightwave3D notes: fixes for base characters + clothes notes

Sunday, 22 May 2011 @ 10:16pm

Many face tweaks.

3d diagram showing where the model face tweaks are and highlighting problem areas

The “entire area” vertex may pinch the mesh strangely with that many patches using it as a corner, but will have to see how I go with the face morphs. Also I’m stupid and the “moved outward” applies to the vertex above the one highlighted, I am too lazy to change the diagram.

ryivhnn v2

Saturday, 21 May 2011 @ 11:08am
ryivhnn v2 with better results from the skin shader

Rapture and armageddon and all that are upon us, and as per usual JJ has taken the kids to 6yo’s Auskick game and I stayed home, trained the dogs (could have gone for another 5mins on top of what I did do but I got defeated by the cold) and ripped through an Anki session with a Lojban gismu deck. We know we’re not going anywhere.

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:

  1. 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
  2. save the file, and keep it in csv format rather than changing to the native format of the spreadsheet
  3. using phpmyadmin, go to the database and find the users table, and select import
  4. 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.

The initial homeschool moderator visit

Wednesday, 18 May 2011 @ 7:24pm

[minor pseudonymising edits during Drupal to hugo migration for all the good that will do now]

We had our initial visit yesterday, with the next one scheduled for another couple of months. Everything went pretty much as expected. The lady was nice, and was happy with all the learning areas except for English and maths, and also wanted to see more “scientific communication”.

Turning a flower blue

6yo and 4yo set up an experiment to turn a flower blue, directed by 6yo, who had seen a demonstration on some science show on ABC. They made the blue water with paint and water (as we don’t have food colouring). They then went on to do some other arty crafty thingies while they waited for the colour to be drawn up to the flower.