Skip to main content
Aug
22
2011

You're doing it wrong

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.

It needs to be cleaned up, if just so I can find the stuff that usually lives on my desk (phone, wallet, Lightwave dongle) easier and the cables are slightly less likely to get tangled.

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.

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
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:

Apr
22
2011

Work, Wannabe and other projects and a dash of unschooling

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.

Mar
06
2011

Drupal 7 notes - putting submenus in different places from the parent menu while keeping your active-trail

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.

<?php
      $main = menu_navigation_links('main-menu', '0');
      echo theme('links__system_main_menu', array(
        'links' => $main,
        'attributes' => array(
          'id' => 'main-menu',
          'class' => array('links')
        ),
      ));
  ?>

Feb
11
2011

Drupal 7 notes - Hiding unwanted form elements in comment forms

Just so I don't drive myself completely insane again.

It's a fairly standard theming problem, you have your Drupal comment form rendering thusly:

Drupal comment form (in WANLN theme)

Your site is set to not allow posting by anonymous users, rendering the "Your name" field superfluous and you think the subject line looks ugly, is unnecessary or you just don't want users giving their comments subjects for whatever reason.

In Drupal 6, you do it like this.  In Drupal 7, it's easier but harder to find.  They're in the docs, but the docs are a bit of a mess still.

Feb
09
2011

Good day, "bad" day

Yesterday was an awesome day.  To counter, I had a rather average day.  Compared to yesterday it was bad, but seriously in the grand scheme of things, it could have been a lot worse.

Jan
28
2011

Organisational skills? What organisational skills?

What's been happening at Wannabe Farmstead? Feels like a lot.  I was out with the dogs at the oval when it occurred to me:

  • I can sort out and adjust training "schedules" in my head fast from observing the dogs while working with them
  • I can work out learning styles and interests of the kids from observation and interaction and work out where to go and things to do that they might find interesting
  • I can work around family stuff with minimal dramas
  • I can do things for clients on time (provided they get me what I need when I say I need it by)
  • I cannot organise my own way out of a paper bag

I should probably do something about that last point.