Skip to main content
Jun
24
2011

Drupal 7 notes: node--[type].tpl.php being ignored

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".

Node type as viewed by phpmyadmin

Jun
23
2011

Drupal 7 notes: the submit button on the node creation form isn't working!

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

<?php echo drupal_render_children($form) ?>

That renders all those sneaky little hidden fields Drupal uses to process and validate form stuff. Use css to hide the vertical tabs if you want them hidden.

Jun
20
2011

World has problems. Quit the rhetoric and fix it.

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.

What you don't want is to get caught in this endless planning loop trying to cover every possible thing that could go wrong and never start.  At some point you just have to suck it up, expect there to be unforeseen difficulties and get on with it.

I feel that there's a lot of rhetoric arguments over "smoke and mirror" problems, which detract from the problems that are causing the "smoke and mirror" problems.  Once these underlying problems have been dealt with, they should magically fix pretty most if not all the "smoke and mirror" problems.  My "solutions" probably still have logic flaws and are extremely basic with no implementation plans or costings because I'm speaking very top level generically and it's going to vary from area to area.

Jun
18
2011

Resonating songs

A few days ago my friend Shae wrote about Alanis Morisette's "Hand in my Pocket" really resonating with her recently, and posed the question of what song particularly resonates with "you" lately.

I've had the chorus of U2's "Trip Through Your Wires" ("You...I'm waiting for you...you...you set my desire, I trip through your wires") running through my head while I work on 3d-bek, and I won't stop believin' (Journey: Don't Stop Believin') that I'll get this bloody animation done.  They are both fairly 3d-centric though.

Some may laugh but the song that's been fairly apt for almost all situations at the moment is the only Savage Garden song I like.

Affirmation

Jun
16
2011

Wacky Wednesday

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.

Heading toward Albany Hwy, the first wacky thing to be encountered was a huge line of cars stuck behind boom gates at the train station.  The Perth train was idling at the platform looking in no hurry to go anywhere.  I eventually inched my way to the intersection as other cars started peeling off in different directions at the intersection.  Watching a transit worker guiding the two cars that were sitting before the boom gates, I figured the boom gates weren't going to be rising any time soon and decided to cut across to Old Fremantle Rd and head to Albany Hwy there.

Jun
03
2011

Reading and writing

Cub 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" (Tao used to pronounce it "ba-goo-doos" when he was Cub's age :) and that's as far as I've gotten with Malay; my vocabulary is shocking and grammar non-existant.

May
24
2011

Drupal 7 notes: unserialize() and undefined index notices after importing users from a csv

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 7 unserialize() and undefined index errors

Yeh right.

May
22
2011

Lightwave3D notes: fixes for base characters + clothes notes

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.

There are also two  points on the torso along the obliques and on the top part of the shoulder blade that need looking at on the Flier models, I fixed them at some point on Base.

After moving the corners of the mouth inward, the insides of the mouth will also have to be readjusted so they're not poking through.

May
21
2011

ryivhnn v2

ryivhnn v2 with better results from the skin shader

Rapture and armageddon and all that are upon us, and as per usual Josh has taken the kids to Tao'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.

With the few precious moments of time alone, I then plugged into Lightwave for more practise on avatars before tackling AEfter Ragnarok characters.

May
19
2011

Drupal 6 notes: dealing with a users.csv file

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: