Creating custom tokens in Drupal 7

How to create custom tokens in Drupal 7 ?!

I have the PHP code needed in order to return a desired value based on NID. However, I don't know how to make the PHP code a token available everywhere at my site.

Any ideas ?! Thanks.

Heartbeat module not working!

After I Enable heartbeat module
i get these errors ( it is displayed in every page ):

Deprecated function: Function eregi() is deprecated in heartbeat_decode_message_variables() (line 87 of C:\xampp\htdocs\drupal\sites\all\modules\heartbeat\heartbeat.common.inc).

Warning: Parameter 1 to heartbeat_user_load() expected to be a reference, value given in DrupalDefaultEntityController->attachLoad() (line 334 of C:\xampp\htdocs\drupal\includes\entity.inc).

please help i need this module!!

New Module "Term Delete Replace"

Hey everyone,

I've just released my first D7 module called "Term Delete Replace". I would love to get some feedback of the code as well as it's functionality and the whole idea of what it does. For more information and details please check out it's sandbox page at http://drupal.org/sandbox/nylin/1137708

/ Thanks!

yellowpages with Drupal? any chance?

I am looking to build a community which services can be listed. Very close to something like Yellowpages. What modules should I be looking at? Thank you.

Tabs D7

Hello i am curious if anyone can help me how to create tabs inside nodes?

I want to show tabs of nodes inside a node.
Or it would have be nice if Fieldgroup supported multiple items per nodes but multigroups are not allowed in D7 nor there is any plugin that supports this functionalities?

Any one has any idea how to make this?
Can i use views maybe?

Switching two forms using ajax

Hi guys!
I would like to ask for your help to solve a problem that is literally driving me nuts!

The idea is very simple:
Given a form1 (that includes a label1 and button1)
- clicking button1 it swaps form1 with form2 (that includes a label2 and button2);
- clicking button2 it swaps it back to form1;
- use ajax to avoid page reloading

I tried several approaches but so far I collected any result. The main issue seems that the form2 once replaces form1 has no ajax abilitated thus leading to a page reload once button2 is clicked.

Let me show u the code:


function item_fields($form, &$form_state)
{
$form['name'] = array(
'#type' => 'item',
'#title'=> $ghost_name,
'#prefix' => '

',
);

$form['action'] = array(
'#type' => 'button',
'#value'=> 'Edit',
'#executes_submit_callback' => FALSE,
'#suffix' => '

',
'#ajax' => array(
'callback' => 'item_to_edit',
'wrapper' => 'item_fields',
),
);
return $form;
}

function item_to_edit($form, $form_state)
{
return drupal_get_form('edit_fields');
}

function edit_fields($form, $form_state)
{
$form['name'] = array(
'#type' => 'textfield',
'#default_value'=> $ghost_name,
'#prefix' => '

',
);

$form['action'] = array(
'#type' => 'button',
'#value'=> 'save',

Pages

Subscribe with RSS Subscribe to RSS - Drupal 7.x