User login

Changents

Redirect to Drupal front page

<?php
    // if the data's not good, send us to the home page
    // note:  drupal_goto without any arguments sends to / - the front page
    // or could use <front> -- url() is called and treats the same
    // so this is not necessary:
  return drupal_goto(drupal_get_normal_path(variable_get('site_frontpage', 'node')));
 
   // this will do:
  return drupal_goto();
?>

Resolution

File uploads and Drupal 5 forms

sudo svn commit -m "uploading images will work so much better with the enctype set"

The important part, the lack of which is what was making image uploads simply not work for what were at the time unknown reasons, is the last line: $form['#attributes']['enctype'] = 'multipart/form-data';. For the file form element to work, for the file to be able to upload, the entire form's encoding type has to be set to multipart.

Allow people to upload user pictures during registration

Well that's annoying.

Spend a good chunk of time creating a module to address a need, return to the thread that's been discussing it since 2006 June to post your efforts and discover it's just been updated to report that the module has been around since 2007 November.

[Download Agaric's user_reg_picture module anyway.]

Image link rollovers for dynamic (user-uploaded) graphics with Drupal and CSS

The goal: a CSS-only rollover graphic that can also be a link that is uploaded by users.

Eliminating other options:

This could be done with JavaScript, but we and the W3C and everyone's sanity would much prefer a pure CSS solution.

Can you have inline styles with pseudo classes (namely, :hover?)

No: http://www.frontpagewebmaster.com/m-351101/tm.htm

Where in the theme are the tabs printed / giving tabs to admins only

On giving View, Edit, Revision, etc. tabs to administrators only.

In Drupal, tabs are not printed by the node, but by the page. On the one hand, since views and administrative pages and anything else you can think of can have tabs, this makes sense. But on the other hand every node can have

But in any case, if you're looking to change the presentation of tabs somehow (or as in our case, restore them to a theme design from which they had been removed), you will find the place to look is not node.tpl.php but page.tpl.php.

Open external URLs in a new window

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

Sidebar graphics with links ("promotional badges") the Agaric Drupal way

A note of warning about the length of notes to follow: This is site configuration at the point where it verges on developer documentation, such is the power of Drupal, and there's some outright theming in here too. This article is a reaction to doing sidebar graphics the painfully non-Drupal way.

Theming CCK Views the Agaric Way (with background)

Note that Views and CCK's imagefield module have excellent imagecache integration and you only need these steps if you want very fine-grained control-- in our case, automatically populating the ALT text of the image with the node title.

/admin/build/views/wizard

and

http://agaricdesign.com/note/how-theme-lots-views-agaric-way

and then a little

Administration menu initial settings

For the necessary admin_menu module, I prefer the initial settings to not collapse fields on the modules page

With current initial settings this means unchecking "Apply margin-top to page body" and "Collapse fieldsets on modules page." Instead of going through this step every time this should be rolled into Agaric's basic/base installation profile.

Resolution

Getting trained by Eclipse PDT: Opening an existing folder of files as a project

So you have a directory structure of a project, say it's a giant site you're taking over, and you want to open it as a project in Eclipse PHP Development Tools (PDT) to be able to use the project-wide search and other cool tools.

I just spent an hour trying to do it through File » New PHP Project and then naming the existing spot in the file system for the folder with all the code. This did not work. It completed without error, but if it were even creating the project I have no idea where it was putting them.

Creating a project in the default location did work.

Syndicate content