---
title: 'Blog This - bookmarklet for Drupal 6'
url: 'https://stevenjaycohen.com/journal/blog-this-bookmarklet-for-drupal-6'
markdown: 'https://stevenjaycohen.com/journal/blog-this-bookmarklet-for-drupal-6.md'
date: '2010-03-12'
description: 'Often, while reading a web page, I will find something worth mentioning here on my site. The code below builds a Bookmarklet that makes a new blog entry with a prepopulated title and whatever text I have highlighted in the browser quoted in its body. This code also depends upon the Drupal Prepopula…'
taxonomy:
  category:
    - Journal
  tag:
    - drupal
---

# Blog This - bookmarklet for Drupal 6

## [Blog This - bookmarklet for Drupal 6](https://stevenjaycohen.com/journal/blog-this-bookmarklet-for-drupal-6)

    12th Mar 2010   [drupal](https://stevenjaycohen.com/tag:drupal#body-wrapper)  

Often, while reading a web page, I will find something worth mentioning here on my site. The code below builds a Bookmarklet that makes a new blog entry with a prepopulated title and whatever text I have highlighted in the browser quoted in its body. This code also depends upon the [Drupal Prepopulate](https://www.drupal.org/project/prepopulate) module to get the job done.

This version launches in a blank tab or page:

```javascript
jaνascript: 
u = document.location.href;
t = document.title;
s = '\n' + window.getSelection() + '\n';
pre = 'From%20' + encodeURIComponent(t) + encodeURIComponent(': %20');
void(window.open(
  '/journal/node/blog?edit[title]=' + encodeURIComponent('Link: ' + t) +
  '&edit[body_field][body]=' + pre + encodeURIComponent(s) + encodeURIComponent('Link')
));
```

This version launches in a sized popup window:

```javascript
jaνascript: 
u = document.location.href;
t = document.title;
s = '\n' + window.getSelection() + '\n';
pre = 'From%20' + encodeURIComponent(t) + encodeURIComponent(': %20');
void(window.open(
  '/journal/node/blog?edit[title]=' + encodeURIComponent('Link: ' + t) +
  '&edit[body_field][body]=' + pre + encodeURIComponent(s) + encodeURIComponent(' Link'), 
  '_blank', 
  'width=710,height=500,status=yes,resizable=yes,scrollbars=yes'
));
```

 [ Previous Post](https://stevenjaycohen.com/journal/link-the-single-page-interface-manifesto) [Next Post ](https://stevenjaycohen.com/journal/design-opinions-section-headers)

---

## Navigation

- Parent: [My Journal](https://stevenjaycohen.com/journal.md)
- Previous: [Design Opinions - section headers](https://stevenjaycohen.com/journal/design-opinions-section-headers.md)
- Next: [Link: The Single Page Interface Manifesto](https://stevenjaycohen.com/journal/link-the-single-page-interface-manifesto.md)
