DrupalBin
Submit Code
About
Recent Posts
Code
1 hour 44 min
ago
weird filefield with mp3 embed object
2 hours 32 sec
ago
D6 FAPI Examples
2 hours 28 min
ago
returning to the same code a second time doesn't have the $form_values argument set
6 hours 48 min
ago
more
Tags
CCK
drupal
fapi
jquery
menu
module
Panels
security scanner
simpletest
test
theme
views
more tags
User login
Log in using OpenID:
What is OpenID?
Username:
*
Password:
*
Create new account
Request new password
Log in using OpenID
Cancel OpenID login
Home
theme
call template file, pass variables
August 5, 2008 - 11:41pm — Anonymous
<?php
$text
= theme
(
'apply_template'
,
$data
)
;
return
$text
;
function
theme_apply_template
(
$data
)
{
ob_start
(
)
;
include
path_to_theme
(
)
.
'/my-block.tpl.php'
;
block
template
theme
Read more
Example of avoiding $content and themeing $node sectins directly
August 5, 2008 - 9:28am — Anonymous
<div
class
=
"node<?php print ($sticky) ? "
sticky
" : "
"; ?> blog"
>
<?php
if
(
$page
==
0
)
:
?>
<h1
class
=
"title"
><a href=
"<?php print $node_url ?>"
title=
"<?php print $title
CCK
node
theme
Read more
Fix for Customizing pager
July 15, 2008 - 7:27am — Anonymous
function
zen_pager
(
$tags
=
array
(
)
,
$limit
=
10
,
$element
=
0
,
$parameters
=
array
(
)
)
{
global
$pager_total
;
$output
=
''
;
if
(
$pager_total
[
$element
]
>
1
)
{
template.php
theme
Read more
Customizing pager
July 11, 2008 - 6:31am — Anonymous
function
zen_pager
(
$tags
=
array
(
)
,
$limit
=
10
,
$element
=
0
,
$parameters
=
array
(
)
)
{
global
$pager_total
;
$output
=
''
;
if
(
$pager_total
[
$element
]
>
1
)
{
template.php
theme
Read more
relative date in comments
June 27, 2008 - 7:20am — Anonymous
function
tassoman_comment_view
(
$comment
,
$links
=
array
(
)
,
$visible
=
1
)
{
static
$first_new
=
TRUE
;
// comment time difference
static
$comment_previous_timestamp
;
comments
theme
Read more
custom node template
June 26, 2008 - 9:44am — Anonymous
<div
class
=
"content"
>
<?php
print
content_format
(
'field_buildings_img'
,
$field_buildings_img
[
0
]
)
;
?>
<?php
print
check_markup
(
$node
->
content
[
'body'
]
[
'#value'
]
)
?>
CCK
template
theme
Read more
Fix for overriding favorite nodes links
June 23, 2008 - 10:51am — Anonymous
function
phptemplate_links
(
$links
,
$attributes
=
array
(
'class'
=>
'links'
)
)
{
$output
=
''
;
if
(
count
(
$links
)
>
0
)
{
$output
=
'<ul'
.
drupal_attributes
(
$attributes
)
.
'>'
;
module
theme
Read more
Fix for overriding favorite nodes links
June 23, 2008 - 10:45am — Anonymous
function
phptemplate_links
(
$links
,
$attributes
=
array
(
'class'
=>
'links'
)
)
{
$output
=
''
;
if
(
count
(
$links
)
>
0
)
{
$output
=
'<ul'
.
drupal_attributes
(
$attributes
)
.
'>'
;
module
theme
Read more
Fix for overriding favorite nodes links
June 23, 2008 - 10:05am — Anonymous
function
phptemplate_links
(
$links
,
$attributes
=
array
(
'class'
=>
'links'
)
)
{
$output
=
''
;
if
(
count
(
$links
)
>
0
)
{
$output
=
'<ul'
.
drupal_attributes
(
$attributes
)
.
'>'
;
module
theme
Read more
Fix for Replace theme functions in live code.
June 21, 2008 - 4:20am — Anonymous
/**
* Clever hack to hide display of blocks during wizard.
*
* The wizard installation tries to keep things as simple and uncluttered
* as possible, making basic use of the menus and forms.
eval
theme
wizard
Read more
1
2
next ›
last »