Add this blog to Del.icio.us, Digg or Furl | Create Watchlist for this blog

Proposal for a CSS ancestor grouping syntax

July 23rd, 2008

What we need

I am missing a syntax to apply a common ancestor to a set of rules. As far as I know, there’s no such concept in CSS selector syntax.

With the increasing usage of CSS definitions to style HTML markup, CSS files grow bigger and bigger. With this it’s getting more and more complex to find rules that apply the a special element and/or to have one’s code structured properly. When ie8 will support the more sophisticated locators like adjacent siblings or attribute selectors the locators and files likely will continue to grow.
Also CSS gets used in situations where you import content from several providers to display it inside one “mashup” site or (like in iGoogle or the Vista desktop) as “snippet”. In this situation one needs to separate the CSS rules of the different providers from each other and from the mashup’s home style.

Basically I want to grab remote content then wrap the grabbed sourcecode into a i.e. a <div id=”#GG”> and integrate that code together with it’s CSS in my site (or fridge display or whatever).

How it could work

The solution to this would be a ancestor grouping concept, i.e.:

ancestor "#GG" {
a { color: black; }
p { margin-top: 3em; }
}

This syntax should then expand to:

#GG a { color: black; }
#GG p { margin-top: 3em; }

Far more added value would be provided by the following construction:
ancestor "#GG" { @import(google.com/styles.css); }

or inside the HTML markup:
<link rel="StyleSheet" href="http://google.com/style.css" type="text/css" ancestor="#GG">

I think the goal should be clear now. Read the rest of this entry »

CSS Selectors - Short Reference

June 23rd, 2008

This is a “short as possible” reference for CSS selector syntax. Intended audience should be very familiar with XHTML, DOM and CSS Styling.

Basics

Type selector
Select all HTML elements of a special type.
Example: em {font-weight: bold;}
Class selector
Select all elements with a given class.
Example: .classname {font-weight: normal;}
ID selector
Select the one element with a given id.
Example: #idname {font-weight: normal;}
Concatenator
Select HTML elements of special type only with given class/id.
Example: em.classname, em#idname {font-weight: normal;}
Universal selector
Select all elements.
Example: * {padding:0;}
Descendent selector
Select all elements that are lower down in the DOM tree (descendants).
Example: p em {font-weight: normal;}
-> Applies to all em's within p's.

Advanced

Child selector
Select all elements that are children in the DOM tree (direct descendant).
Example: p > em {font-weight: normal;}
-> Applies to all em's directly within p's, not supported by ie6 and below.

Adjacent sibling selectors
Select all elements that are on the same DOM level in the same DOM subtree
Example: h3 + p {font-size:80%;}
-> Applies to all p's that "belong" to a h3

Read the rest of this entry »

UI Brainbreaker

June 11th, 2008

Since a while I am thinking about a better possibility to present a link-matrix to my users. Currently it’s just a matrix where I have the topics as lines and a geographic location for each topic as column.
Now, if the user searches for “gewerblicher Rechtsschutz München” she navigates to the line “gewerblicher Rechtsschutz” and to the column 8 (what is the region code for München).

There are several drawbacks:

(1) Too many links on this one page
(2) Too much visual impression confuses the user
(3) Too hard to point to the small href links inside the matrix’s cells

Now - I am thinking about a solution with jQuery…
Anyone any idea? Thanks.

Favorite current project

June 4th, 2008

My favorite current project is opentimesheet.org.
It’s about efficient online time registration and recording.
Last 14 years as freelancer I was using a horrible number of time capturing systems. Actually I am using about three at a time now. There are so many of them, and most companies invent their own - starting with excel - ending up in a very special time consumptive “solution”.

Break the rule - join the new open source project!

Back in the dawn of the internet

May 20th, 2008

When I googled my name today, I found really interesting posts that are 12 years old. Thanks to google for awakening those sweet memories.

It’s about FFT transformations and I found it in Google Groups.

For those of you who are not grandfathers… before www got popular, we were communicating via usenet - groups :-)

Man, 12 years old … and still in the google cache!

A German Disclaimer

May 2nd, 2008

When you run a website in Germany, you’re worried by laws. Some think you need a disclaimer or “Haftungsausschluss”, some think you don’t.
I found a lawer’s text that’s free for copying. So If you need, or need not, a disclaimer for your Page running in Germany (whatever “in” means) take this free disclaimer.

Installing Drupal 6 “upgrade save”

April 11th, 2008

Drupal is upgrading very frequently. Specially nowadays as V6 is out for a view weeks. If you don’t want to get mad upgrading Drupal every other day - here are some hints to follow when installing Drupal6.

Most important: If you have more sites running on one server: Do a multisite installation!

Assuming you have your Apache root at /srv/htdocs do the following:

  1. Download Drupal 6.1 and tar xvzf it in /srv
  2. Now you have /srv/drupal-6.1
  3. Create a symlink like ln -s drupal-6.1 drupal
  4. Now you also have /srv/drupal (pointing to /srv/drupal-6.1)
  5. Now create a symlink for apache: I.e. ln -s /srv/drupal /srv/htdocs/drupalweb and let your virtual domain (or where ever Drupal will run) point to /srv/htdocs/drupalweb as httdocs root.

Your ready with your update-prepared ionstallation.

When an upgrade to Drupal 6.2 appears (it did view days ago), do the following:

  • mysqldump your drupal database (just for security and possible rollbacks)
  • copy cp -r -p /srv/drupal-6.1 /srv/drupal-6.2 the 6.1 to the new 6.2 installation (so you can rollback if necessary)
  • in /srv/drupal-6.2 preserve your sites directory by renaming it, i.e. mv sites sites_old
  • now, in /srv untar the 6.2 distribution tar xvzf drupal-6.2.tar.gz
  • remove the new sites dir and move back your preserved: rm -r sites, mv sites_old sites
  • now relink your master: rm /srv/drupal; ln -s drupal-6.2 drupal
  • and browse to update.php of your site.

Keep in mind to check, if there’s something important new in settings.php…
And with this kind of installation you are perfectly prepared for multisite! And for sure it doesn’t work with MS scrappy OS’s.

And have fun!

Feeding “static” sites from Drupal nodes

February 26th, 2008

This is about how I manage to create content for domains without CMS from a Drupal enabled domain without any manual work.

On address www.immobilien-spot.de I am running a community for real estate agents. It’s primary focused on Immobilien in München (that’s German for real estate in Munich).

Estate agents can become members, can show 10 of their best buildings and act like usual in communities (Blog, Forum, Contact…). Additionally the agents can book a special site to promote one of their offers, i.e. an office loft for rent. This office loft is shown in the offer list and also on a static site called officeloft.de (this is an example, I don’t own that domain). To feed the content of officeloft.de from the Drupal content on immobilien-spot.de, I’ve established a special node type called a “promotion”.

A promotion node consists of a node-ref (pointing to the estate offer node), an entry place (office-loft.de) and a booking period (March 2008). To render the promotion node completely different from all other nodes, I have installed the sections and pathauto modules for Drupal. With pathauto one can automatically create special paths for nodetypes, and with sections.module one can assign special page.tpl.php for this path.

What’s left is to have a nightly cronjob that copies the rendered promotion node to the special site’s http-root directory (what should be a subdirectory of the main domains http-root - else you have to struggle with your OS). And finally transpose all of the relative path’s inside the copy to be absolute.

Have fun!

SUN to buy MySQL AB

January 23rd, 2008

As Mr. Schwartz, CEO of SUN Microsystems wrote here, SUN is going to acquire MySQL AB for about 1 Billion Dollars.

What does this mean to Oracle, Sybase, DB2 and MSSQL Server?

It’s out of the question, that MySQL is the most used Database worldwide. The main reasons are, that MySQL runs with poor hardware, it’s easy to install, to administrate and to use. And it’s for free. When I look back at my jobs in the trading area of investment banks, I remember lot’s of Solaris/Sybase installations. Now, I foresee problems for Sybase here. When I look back at my jobs in the backoffice area of retail banking, I remember lot’s of Solaris/Oracle and AIX/DB2 installations. Will SUN MySQL be as reliable as Oracle or DB2 is? Then I foresee problems here as well.

Why should one pay for Oracle or DB2 when MySQL comes from SUN and is for free?

I am sure MSSQL will keep it’s place in the low-range small office area - just because of the MS certified staff that’s working here. But I foresee huge problems (see here also) for the big systems Oracle, Sybase and DB2.

All the IT world is moving to open source !!!

And that’s a good way

Most challenging project

January 10th, 2008

These days I have lot’s of fun and blitheness :-)

Feeding my child