Skip to content

Commit 7f5522f

Browse files
committedJan 13, 2015
added Blog content type feature
1 parent 3b96519 commit 7f5522f

6 files changed

+145
-0
lines changed
 
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
<?php
2+
/**
3+
* @file
4+
* proba_blog.features.field_base.inc
5+
*/
6+
7+
/**
8+
* Implements hook_field_default_field_bases().
9+
*/
10+
function proba_blog_field_default_field_bases() {
11+
$field_bases = array();
12+
13+
// Exported field_base: 'body'
14+
$field_bases['body'] = array(
15+
'active' => 1,
16+
'cardinality' => 1,
17+
'deleted' => 0,
18+
'entity_types' => array(
19+
0 => 'node',
20+
),
21+
'field_name' => 'body',
22+
'foreign keys' => array(
23+
'format' => array(
24+
'columns' => array(
25+
'format' => 'format',
26+
),
27+
'table' => 'filter_format',
28+
),
29+
),
30+
'indexes' => array(
31+
'format' => array(
32+
0 => 'format',
33+
),
34+
),
35+
'locked' => 0,
36+
'module' => 'text',
37+
'settings' => array(),
38+
'translatable' => 0,
39+
'type' => 'text_with_summary',
40+
);
41+
42+
return $field_bases;
43+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
<?php
2+
/**
3+
* @file
4+
* proba_blog.features.field_instance.inc
5+
*/
6+
7+
/**
8+
* Implements hook_field_default_field_instances().
9+
*/
10+
function proba_blog_field_default_field_instances() {
11+
$field_instances = array();
12+
13+
// Exported field_instance: 'node-blog-body'
14+
$field_instances['node-blog-body'] = array(
15+
'bundle' => 'blog',
16+
'default_value' => NULL,
17+
'deleted' => 0,
18+
'description' => '',
19+
'display' => array(
20+
'default' => array(
21+
'label' => 'hidden',
22+
'module' => 'text',
23+
'settings' => array(),
24+
'type' => 'text_default',
25+
'weight' => 0,
26+
),
27+
'teaser' => array(
28+
'label' => 'hidden',
29+
'module' => 'text',
30+
'settings' => array(
31+
'trim_length' => 600,
32+
),
33+
'type' => 'text_summary_or_trimmed',
34+
'weight' => 0,
35+
),
36+
),
37+
'entity_type' => 'node',
38+
'field_name' => 'body',
39+
'label' => 'Body',
40+
'required' => FALSE,
41+
'settings' => array(
42+
'display_summary' => TRUE,
43+
'text_processing' => 1,
44+
'user_register_form' => FALSE,
45+
),
46+
'widget' => array(
47+
'module' => 'text',
48+
'settings' => array(
49+
'rows' => 20,
50+
'summary_rows' => 5,
51+
),
52+
'type' => 'text_textarea_with_summary',
53+
'weight' => -4,
54+
),
55+
);
56+
57+
// Translatables
58+
// Included for use with string extractors like potx.
59+
t('Body');
60+
61+
return $field_instances;
62+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
<?php
2+
/**
3+
* @file
4+
* proba_blog.features.inc
5+
*/
6+
7+
/**
8+
* Implements hook_node_info().
9+
*/
10+
function proba_blog_node_info() {
11+
$items = array(
12+
'blog' => array(
13+
'name' => t('Blog'),
14+
'base' => 'node_content',
15+
'description' => t('Blog post'),
16+
'has_title' => '1',
17+
'title_label' => t('Title'),
18+
'help' => '',
19+
),
20+
);
21+
drupal_alter('node_info', $items);
22+
return $items;
23+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
name = Proba Blog
2+
core = 7.x
3+
package = Features
4+
dependencies[] = features
5+
dependencies[] = text
6+
features[features_api][] = api:2
7+
features[field_base][] = body
8+
features[field_instance][] = node-blog-body
9+
features[node][] = blog
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
<?php
2+
/**
3+
* @file
4+
* Code for the Proba Blog feature.
5+
*/
6+
7+
include_once 'proba_blog.features.inc';

‎proba.info

+1
Original file line numberDiff line numberDiff line change
@@ -5,3 +5,4 @@ core = 7.x
55
dependencies[] = block
66
dependencies[] = dblog
77
dependencies[] = admin_menu
8+
dependencies[] = proba_blog

0 commit comments

Comments
 (0)
Please sign in to comment.