User login

How to

Information on how to do something... anything.

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

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.

Using CVS for developing modules

We can commit to Drupal.org CVS and use it just like we use subversion to manage our sites. No more trying to develop a module in subversion and contribute changes to CVS, just do everything in CVS. It's not that much worse than SVN.

Don't believe me? Watch:

Get Linux running on your Linksys Router

Recently my router was giving me some problems, the worst type, dropped signal!

After hours of searching around in forums and such, I concluded that it must (hopefully) have something to do with Linksys's generally bad router software, you know, the page you goto to make all your settings and stuff... usually found at 192.168.1.1

Creating a random password... the Drupal way

Lesson of the day: don't reinvent Drupal functions.

Making a quick random number

Not truly random in some cosmic computer science sense, but good enough for non-mission critical (or rather, nothing for anyone to exploit the not-complete-randomness) uses.

http://www.php-scripts.com/php_diary/122799.php3

<?php
srand(time());
$random = (rand()%9);
?>

Resolution

Aquasoft / MGP-Forum style CSS background graphical menu for Drupal primary links

We first used this technique from the aquasoft theme on a 4.7 site, MGP-Forum, and just used it again, updated for Drupal 5 and with one enhancement by us.

Here's the D5 version from Aquasoft:

Show menu in page

Set the input format for your node body or other textarea to PHP code, figure out what the menu ID of the menu item you care about as described by Nick Lewis (from whom all of this is stolen), and then stick this in your content:

<?php
$html = theme_menu_tree(42);
print $html;
?>

It could also go in a theme or somewhere else silly.

Resolution

Node relativity display: do not show children

can you help me make node relativity not show the children list below the node like that?

Go to administer settings or whatever Node Relativity and click on the Display Settings tab, and change the section from a number (weight) to zero - 0 - which means don't display.

Resolution

Use drupal_set_message with print_r to see the view code

Moving this tip over from where I posted it at Lullabot in their 50 tiips thread.

Specifically, put this in the custom argument code:

<?php
drupal_set_message('<pre>' . print_r($view, TRUE) . '</pre>');
?>

(PHP tags used for formatting here and are not entered into the argument code textbox.

To do this on a live site without regular folks seeing, while you're online as user #1, you can use this:

Agaric asks itself: help. views arguments? Taxonomy, nodes, and context

The Question: How to use arguments to make a block view show content associated with pages

ok

so there are industry pages under the industry dropdown. AND there are products pages under the products dropdown, products is its own content type, industry pages are pages, the products content type has a vocabulary associated with it that basically has all the industries in it.

Syndicate content