Drupal “Rewrite the output of this field” replacement patterns

Category: 

As a quick note, if you’re looking at a Drupal form and it says you can use the "Rewrite the output of this field" replacement patterns shown (somewhere) on this page — and you can’t find those replacement patterns on that page — you can find a complete list of them at this drupal.org url.

As an example, if you’re working with a Drupal Node, you can use replacement patterns like these:

[node:author:name]
[node:content-type]
[node:content-type:name]
Tags: 
Tags: 
Tags: 
Tags: 

CSS even/odd row selectors (zebra striping)

Category: 

As a quick CSS note, if you want to achieve a “zebra striping” style with even and odd CSS row selectors, CSS styles like this will get the job done:

.path-frontpage .content-inner-right .content-type-Text:nth-child(even) {
    /* yellow */
    background-color: #fdfdf6;
}

.path-frontpage .content-inner-right .content-type-Text:nth-child(odd) {
    /* blue */
    background-color: #f3fbff;
}

I use that CSS for the front page of this website, but if you want a simpler example, here you go:

Tags: 
Tags: 
Tags: 
Tags: 
Tags: 
Tags: 
Tags: 
Tags: 
Tags: 
Tags: 

SQL - How to select every row from a table where a column value is not unique

Category: 

SQL FAQ: How can I select every row from a database table where a column value is not unique?

I’m working on an problem today where a Drupal article can have many revisions, and the way Drupal works is that a table named node_revisions has a nid field for “node id,” and a vid field for “revision id.” If you have five revisions of an article (i.e., a blog post), there will be five records in this table, and each record will have the same nid value and a unique vid. If an article has no revisions, this table will have one entry with a unique nid and unique vid.

Tags: 
Tags: 
Tags: 
Tags: 
Tags: 
Tags: 
Tags: 
Tags: 
Tags: 
Tags: 

Drink wine, rescue dogs

If you know me, you know about Zeus, a rescue dog who came back from a very bad place. As a result of a few friendships I know a few people who would like this t-shirt. The iheartdogs.com website says that sales of this t-shirt help to feed seven shelter dogs (at first I thought that was seven shelters) through their partnership with Rescue Bank. If you like the Rescue Bank mission you can skip the t-shirt and go right to the Rescue Bank donation page.

What you think about when you’re dying

Before I write this, just to be clear, on most days and times I’m not laying in bed waiting to die. But, there have been somewhere between 20-30 times where I have laid down in bed not knowing if I’d ever get up again. Five of those times I passed out. Recent lab tests also show that I almost certainly have something called a paraganglioma, which doctors refer to as a “pharmacologic time bomb.”

Syndicate content