Go straight to content, do not pass menu, do not collect $200
Sep
03
2014

Drupal 7 notes - making javascript work in a modal

0 comments

Or more accurately in my case, making a jquery gallery work inside a modal.  I am really bad at javascript so I have no idea if my hackjob is a good way to do anything but it did what I wanted.

Feb
05
2013

Drupal 7 notes: node or page template by path

0 comments

Because I always seem to manage to completely forget how to do something this basic.

template.php in theme_preprocess_page(&$variables) or theme_preprocess_node(&$variables)

May
25
2012

Drupal 7 notes: html5 placeholder text

5 comments

Fairly straightforward. Mostly here as a reminder for how to do webforms (example has a theoretical nid of 1 and a theoretical form field called “message” and the “submitted” part stymied me for a bit).

Apr
07
2012

Sprat does not share my scss enthusiasm

4 comments

bek 6/04/12 10:23 PM
hee hee other cool thing with sass, i do this:

@mixin inline-block {
 display: inline-block;
 margin: 0 -2px;
 vertical-align: top;
}

and then when i need things inline-blocked etc (in a few places) i do:

#container {
 .stuff-what-needs-inlining {
 {
   @include inline-block;
 }
}


Darqx 6/04/12 10:24 PM
i look at that and see what looks to be php mixed with css and want to run away screaming

Apr
06
2012

css notes: fixed middle fluid outer column

0 comments

Also known as: I'm a blithering idiot.

I spent way too long overthinking this problem and only finding solutions with floats (I have very specific cases where I'll use floats for layout, also I could have missed anything that didn't use floats for layout as I was stupidly staying up way too late when working on this). The way to do it is actually embarrassingly easy. I'll be using it for the header and footer (after I've installed Sassy, prepro and phpsass).

header showing divs for 3 col layout for a fixed width middle and fluid outer columns

The above image is a screenshot of the header image on my local as seen in Opera (because it was the only one that showed the outlines regardless of the z-index).  The middle columns are 950px wide (specifically set in the footer due to it being a background image, not set in the header as the image isn't backgrounded and the div sizes itself to it).

What I specifically needed was for the continuation images to start from the edges of the middle div (the left continuation image of the header and both footer continuations are uneven) and stretch to the edges of the container (which is the same width as the browser window, however wide that may be).

Aug
29
2011

Drupal 7 notes: unsetting formatting tips

9 comments

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

Jun
24
2011

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

1 single solitary comment

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

Mar
06
2011

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

2 comments

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

24 comments

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.

Pages