extra_fields in Field API not displayed in view

Hi,

I've created an entity 'artwork' which has some custom fields, such as 'title' and 'created', and some fields added by the field api. I've specified the custom fields using the following hook:


function artwork_field_extra_fields() {
$extra = array();

foreach(artwork_types() as $type) {
$extra['artwork'][$type->type] = array(
'form' => array(
'title' => array(
'label' => t('Title'),
'description' => t('The name of the artwork'),
'weight' => -5,
),
),
'display' => array(
'title' => array(
'label' => t('Title'),
'description' => t('The name of the artwork'),
'weight' => -5,
),
'created' => array(
'label' => t('Created'),
'description' => t('Created on'),
'weight' => -4,
),
),
);
}

return $extra;
}

function artwork_types() {
$types = &drupal_static(__FUNCTION__);

if (empty($types)) {
$types['painting'] = (object) array(
'type' => 'painting',
'name' => t('Painting'),
'description' => t('A picture made with paint.'),
);
$types['sculpture'] = (object) array(
'type' => 'sculpture',
'name' => t('Sculpture'),
'description' => t('A carving made out of stone or wood.'),
);
}

Set the formatter for a field in the field API

Hey,

I've installed a field that has two formatters: 'dimfield_default' and 'dimfield_table'. The first is the default one. When I create a new instance of a node bundle with that field, the default is run. I am now trying to get the node bundle's field instance to show the table instead formatter without having to reset the default for the field itself. I've looked into the field configuration settings but although I can totally set up and specify my widget, I can't seem to do the same for a formatter.

Can someone explain to me where I can do this?

Same path, different page

I want to refeer the same path to show page with different permission.
For example:

path: node/%node_edition/part
if a user has the "update" permission, show a page, else show another.

I tried with two items with same paths and different access_callback, but only the second is shown (because obviously it rewrite it)

Alter user listing Query

Hi Everybody,
I have altered users table using hook_schema_alter and added user_type(0=Employee,1=Broker,2=Client) field in it, now what i want is to display only employees(user_type=0) at People listing page.
Whenever Administrator click on People link in Administration page, he views all users. But i want to show only employee users.
how can i use hook_query_alter() for this purpose?

How to add comment by script?

I want to add comment by php script. Here is my code:

Taxonomy Menu - Menu path type - The only available option is 'Default'

Hi, I have recently begun using Drupal.

I have version 7.0 installed, along with some Modules, including 'Taxonomy Menu'. I made a vocabulary to serve as the contents of the menu, but now I want to give the menu options paths, because currently they are pointing to taxonomy term pages such as /taxonomy/term/987 which shows "There is currently no content classified with this term". I want it to point to /projectname/projectpage, where both projectname and projectpage are preferably read from custom taxonomy fields.

Pages

Subscribe with RSS Subscribe to RSS - Drupal 7.x