Drupal 5
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
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.
Fastest way to get just one result from a database table in Drupal
To get a single value result – one row from a just one column – the Drupal function for that is db_result(), which takes the result of db_query() as an argument.
http://api.drupal.org/api/function/db_result/5
So the fastest way to get a single result (please pardon the awkwardly named function) would look like this:
<?php
How to theme a Drupal form
Update: This tutorial has been revised significantly to provide a robust solution consistently works.
Define a function named your_theme_name_ or phptemplate_ plus name_of_form($form).
Display a Drupal login form anywhere with PHP, including in page content
Update: I gave slightly incorrect code, I'm pretty sure swapping out 'user_register' to put in 'user_login' will work just fine:
dan hak 3:08
whats the code for the login block
benjamin melançon 3:09
<?php
global $user;
if (!$user->uid) {
?><div class="user-register"><?php
print drupal_get_form('user_register');
?></div>Ask Agaric: Upload photos and display them on a page with introduction
Hi Ben,I have some things like photos and some audio files and whatnot I could add to the site.
How do I know where something will end up and how it will be listed on the menus? For some reason I haven't figured that out.
How to theme (lots of) views the Agaric Way
I3IVIIVI: now, take a look at the template.php file
(10:20:54 AM) Dan Hak: you took out repeating code?
(10:21:15 AM) I3IVIIVI: yes, exactly
(10:21:22 AM) I3IVIIVI: the code that you knew was repeating
(10:21:35 AM) I3IVIIVI: because you weren't even copying it from the wizard anymore
(10:21:49 AM) I3IVIIVI: you were just changing that one spot :-)
In template.php – the generic function followed by an example of a specific invocation. Automatically using a views-list-thememe.tpl.php file if it exists is not implemented with this code.
<?php
/**
* Generic function to theme views, invoked by view-specific callbacks.
*
* Based on code generated by the views theming wizard
Serving up a different page.tpl.php for different browser types (i.e., IE6) with your Drupal theme
if you figure out just the most major IE issues
that would be good enough
Remixing Drupal the Agaric Way: Multilingual Panels
Step 1: Find a function that does some or most of what you want.
Step 2: Find another function that does the rest of what you want.
Step 3: Mash them together.
The situation this time: we have a Drupal 5 site (World Social Forum 2008) with i18n (internationalization module) and need translated content to show up in panels.
