drupal最小调试页面

<?
//ini_set(‘display_errors’, FALSE);
require_once ‘./includes/bootstrap.inc’;
drupal_bootstrap(DRUPAL_BOOTSTRAP_FULL);

可以调用所有drupal内核库函数,比如数据库操作函数。

比如我要截取 “$0.03/word”中的数字0.03

preg_match(‘/\$(.*)\/word/’, $rate, $matche);
if($matche[1])
{
$rate = $match[1];
}  

I finally figured it out after seeing the help text in the 5.x-1.6 release, although I haven’t tried it in the 4.7 version for which I originally had the confusion.
 

For a ‘Single on/off checkbox’ widget, define the ‘off’ value first, then the ‘on’ value in the Allowed values section. Note that the checkbox will be labeled with the label of the ‘on’ value.

 

So here’s what you would do:

1) Add a Single on/off checkbox integer field.

2) Don’t worry about changing the "Label" field since this does not does not have anything to do with what is displayed as the label.

3) Enter the following two values in the Allowed values list:
0|do not display
1|Display in Sidebar

Now when you go to create content page for you content type you should have a checkbox with a "Display in Sidebar" label.