Living Conversations

Open external URLs in a new window

Key words and phrases: 
open external URL in new window or tab external link check
Description & Info: 

Personally and professionally I think links should open in the same tab, but some clients insist on opening external links in new tabs.

<?php
/**
* Override theme_menu_item_link
* http://api.drupal.org/api/function/theme_menu_item_link/5
*/
function phptemplate_menu_item_link($item, $link_item) {
// make external links open in new windows

Print a form, such as a search form, anywhere in Drupal

Key words and phrases: 
form anywhere print form print search form drupal print the searchform
search_form_in_page.png
Description & Info: 

Resolved error:

Missing argument 1 for search_box(), called in /sites/example/www/includes/common.inc(1352) : eval()'d code on line 5 and defined in /sites/example/www/modules/search/search.module on line 1037.

This was from code added to a page's content by a client or possibly even the previous developer. We completely redid the site but did copy-paste in some pages.

Save as draft

Key words and phrases: 
unpublish hide content do not show node until ready
Description & Info: 

Add a “Save as Draft” function to the blog, similar to other blogging programs.

If client doesn't have administer nodes privileges-- but she does, right?)

http://drupal.org/project/save_as_draft
dan hak 12:18
she does
benjamin melançon 12:19

Put edit block links on blocks for easy use by administrators

Key words and phrases: 
Extra trick provide edit links to block and view blocks for admin users
Description & Info: 

UPDATE: The Zen Theme does this so, so much better, so we'll be stealing from it as soon as we get the chance.

Provide edit links to block and view blocks for admin users by modifying block template files in your theme.

Add an image to a block

Key words and phrases: 
embed image in text block content sidebar blocks graphic in context attach picture to block box
Description & Info: 

How do we add an image to a custom defined, textual block?

You can change menus here:

Edit the custom block in question, at a URL like:

http://example.com/admin/build/block/configure/block/41

by Benjamin Melançon
Posted on Wed, 2008-04-02 06:07
in

Ask Agaric: Getting the E-mail Addresses of Your Site's Users

Key words and phrases: 
Drupal user email addresses participant e-mails access people's emails
Description & Info: 

How do you harvest e-mail lists for all of the site users?

(Agaric note: Harvest is often used in the context of spammers "harvesting" electronic mail addresses; this is a matter of the site owner getting e-mails provided by site users, to which the site owner already has access, in a useful form. We skipped the terminology sermon and just wrote back...)

Drupal RSS Feed Not Working: Check Alias Conflict

Key words and phrases: 
url alias RSS really simple syndication page not found node feed conflict with blog
Description & Info: 

If you have a Drupal RSS feed, such as blog/feed, that instead takes you to only a node, check that there is no path alias created (go to admin/build/path) for, in this example, 'blog/feed'.

Theme Drupal search results

Key words and phrases: 
themeing search results view
Description & Info: 

theme_search_item($item, $type)

http://api.drupal.org/api/function/theme_search_item/5

http://drupal.org/node/175013 => Customize the search results page

A separate issue raised in IRC:

now to disable user searching.
[07:50am] ben-agaric: http://drupal.org/node/85137 - Remove tab from search page
Better general instructions for removing a tab: http://drupal.org/node/68792

In template.php, do not paste in opening <?php tag if one has already been opened and the closing ?> tag should be dropped from the end of all Drupal module and theme files per coding standards:
<?php
function phptemplate_search_item($item, $type) {
$output = '

'. check_plain($item['title']) .'

';
$info = array();
if ($item['type']) {
$info[] = check_plain($item['type']);
}
if (user_access('administer content')) {
if ($item['user']) {

On the value of automatic messages that gather data to define themselves

Description & Info: 

So you don't look as silly as this:

[Error message] Files with the extension mp4 are not allowed. Please upload a file with an extension from the following list: avi mpg ogg wmv mov. [/Error message]

Forum post listed in count, not showing up in Drupal forum

Key words and phrases: 
Topic counted but does not show in forum drupal forum not showing all posts
Description & Info: 

The overview, with three posts promised:
http://lclive.openzuka.net/forum

The forum, with only two posts:
http://lclive.openzuka.net/forum/45

The absent post, that says it is in the forum:
http://lclive.openzuka.net/great_story

Similar problem?

Topic not showing up in forum
http://drupal.org/node/219342