drupal

Setting subtheme CSS

Font size too big for a title with a link.

It’s because there are 30% increase by both .title and .title a. So, font size of a title and that of a link in a title differs. In order not to increase another 30% at a link in a title, add the following code to CSS.

.title a {
  font-size: 1.0em;
}

Creating subtheme

Until recently I was satisfied with the bluemarine theme, but now a few problems bothers me.

  1. Font size is too big for book titles in the book outline of the left sidebar menu.
  2. It’s rather difficult to distinguish h1 and h2 in contents.
  3. On chrome, font size of inlined code is smaller than on IE. (Block-level codes have the same problem when GeSHi filter is set to GESHI_HEADER_DIV, not GESHI_HEADER_PRE.)

I tried to solve those problems with the previously created module’s CSS. But it can’t override theme’s CSS because it’s placed after other modules’ CSS’s but before theme’s CSS. So, I had to follow the standard procedure by creating subtheme. I was somewhat afraid of spending too much time, but creating subtheme itself was very easy.

Multi-language setting - i18n

Configuring Internationalization

After configuring core modules only, pages like front page (=/node, by default) or blog page (=/blog) show original and translated contents mixed. The i18n module solves this problem. Additionally, you can set up some details like prohibiting language neutral contents.

Multi-language setting - locale, translation

After setting ads, I thought that, being rarely known site, perhaps English content might be (at least slightly more) advantageous for exposure to the search engines. And as I remembered that I’d encountered with related topics in drupal documentations, I decided to set up a multilingual site supporting both Korean and English.

During this process, I’ve spent time longer than expected, and had to see the sources of drupal modules. I succeeded to set up a multilingual site, but failed to adjust a few details because of some bugs. Here I summarize it.

Overriding CSS

(Update) Later, switched to creating a subtheme because of a limitation of this method

Looked around, and it looks fine mostly, except that those double border around codes displayed by GeShi filter. Using chrome’s “Developer tools” (which actually was my first experience, and it seems like it’s great and indispensable tool for creating homepage), I found that it is made up of <div class="geshifilter">, <pre>, in that order, and

  1. geshifilter defines the border of div.geshifilter,
  2. drupal theme defines the border of pre,

so, it become double bordered.

Creating custom module!

Couldn’t resist, so I decided to solve the annoying problems. As I’m newbie to drupal, it took some time, but not long.

Prerequisites:

  • Drupal modules basically works by defining hooks.
  • Execution order of different modules is determined by their weights.

That is, you can override results of other modules without modifying them by defining a module with bigger weight. Actually, many sites seems to be constructed that way, to minimize inconvenience during upgrade.

Drupal annoyances

URL alias

I’ve installed the pathauto module and enabled transliteration including Korean, but URL aliases transliterated direct from Korean title never looks good. I found myself keep setting URL path manually, so I turned off automatic alias for node paths.

It would be better if I could enable automatic alias but with checkbox turned off, searching google turns out that it’s in pathauto issue tracker as a feature request but is not yet implemented.

Twitter module

Likewise, I turn off the checkbox “post to twitter” every time. I could modify twitter module, but will not unless I can override it so that I may care less during further module updates.

Story or blog entry?

On this weekend I’m skimming over drupal documentations and trying to take some memo here. Suddenly, I’m concerned about whether to make it as a story or blog entry.

Functionally,

  1. Comparing default content type configurations, they do exactly the same things except name and explanation.
  2. Blog entry can be differentiated by setting taxonomy (e.g., tags).
  3. Blog entry have a default “My Blog” page that shows user’s own blog posts.

As it can be deduced from 3, and also as drupal blog handbook says, blog module is for multiple users. (And, it’s best practice not to use blog module for single user site).

Syndicate content