Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
project
drupal
Commits
427604df
Commit
427604df
authored
Aug 23, 2006
by
Dries
Browse files
- Patch
#80201
: don't show blocks when serving a 404. Saves CPU and bandwidth.
parent
689a61f1
Changes
3
Hide whitespace changes
Inline
Side-by-side
includes/common.inc
View file @
427604df
...
...
@@ -338,7 +338,8 @@ function drupal_not_found() {
if
(
empty
(
$return
))
{
drupal_set_title
(
t
(
'Page not found'
));
}
print
theme
(
'page'
,
$return
);
// To conserve CPU and bandwidth, omit the blocks
print
theme
(
'page'
,
$return
,
FALSE
);
}
/**
...
...
themes/chameleon/chameleon.theme
View file @
427604df
...
...
@@ -3,7 +3,7 @@
/**
* @file
* A slim, CSS-driven theme
.
* A slim, CSS-driven theme
which does not depend on a template engine like phptemplate
*/
function chameleon_features() {
...
...
@@ -21,7 +21,7 @@ function chameleon_regions() {
);
}
function chameleon_page($content) {
function chameleon_page($content
, $show_blocks = TRUE
) {
$language = $GLOBALS['locale'];
if (theme_get_setting('toggle_favicon')) {
...
...
@@ -71,8 +71,10 @@ function chameleon_page($content) {
$output .= " <table id=\"content\">\n";
$output .= " <tr>\n";
if ($blocks = theme_blocks("left")) {
$output .= " <td id=\"sidebar-left\">$blocks</td>\n";
if ($show_blocks) {
if ($blocks = theme_blocks("left")) {
$output .= " <td id=\"sidebar-left\">$blocks</td>\n";
}
}
$output .= " <td id=\"main\">\n";
...
...
@@ -101,8 +103,10 @@ function chameleon_page($content) {
$output .= " </td>\n";
if ($blocks = theme_blocks("right")) {
$output .= " <td id=\"sidebar-right\">$blocks</td>\n";
if ($show_blocks) {
if ($blocks = theme_blocks("right")) {
$output .= " <td id=\"sidebar-right\">$blocks</td>\n";
}
}
$output .= " </tr>\n";
...
...
themes/engines/phptemplate/phptemplate.engine
View file @
427604df
...
...
@@ -147,7 +147,7 @@ function phptemplate_features() {
* generate a series of page template files suggestions based on the
* current path. If none are found, the default page.tpl.php is used.
*/
function
phptemplate_page
(
$content
)
{
function
phptemplate_page
(
$content
,
$show_blocks
=
TRUE
)
{
/* Set title and breadcrumb to declared values */
if
(
drupal_is_front_page
())
{
...
...
@@ -162,23 +162,27 @@ function phptemplate_page($content) {
/**
* Populate sidebars.
*/
$layout
=
'none'
;
global
$sidebar_indicator
;
/**
* Sidebar_indicator tells the block counting code to count sidebars separately.
*/
$sidebar_indicator
=
'left'
;
$sidebar_left
=
theme
(
'blocks'
,
'left'
);
if
(
$sidebar_left
!=
''
)
{
$layout
=
'left'
;
}
if
(
$show_blocks
)
{
global
$sidebar_indicator
;
/**
* Sidebar_indicator tells the block counting code to count sidebars separately.
*/
$sidebar_indicator
=
'left'
;
$sidebar_left
=
theme
(
'blocks'
,
'left'
);
if
(
$sidebar_left
!=
''
)
{
$layout
=
'left'
;
}
$sidebar_indicator
=
'right'
;
$sidebar_right
=
theme
(
'blocks'
,
'right'
);
if
(
$sidebar_right
!=
''
)
{
$layout
=
(
$layout
==
'left'
)
?
'both'
:
'right'
;
$sidebar_indicator
=
'right'
;
$sidebar_right
=
theme
(
'blocks'
,
'right'
);
if
(
$sidebar_right
!=
''
)
{
$layout
=
(
$layout
==
'left'
)
?
'both'
:
'right'
;
}
$sidebar_indicator
=
NULL
;
}
else
{
$layout
=
'none'
;
}
$sidebar_indicator
=
NULL
;
// Construct page title
if
(
drupal_get_title
())
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment