commerce_kickstart_blog.module in Commerce Kickstart 7.2
File
modules/commerce_kickstart/commerce_kickstart_blog/commerce_kickstart_blog.module
View source
<?php
include_once 'commerce_kickstart_blog.features.inc';
function commerce_kickstart_blog_migrate_api() {
if (variable_get('commerce_kickstart_demo_store', FALSE)) {
return array(
'api' => 2,
'migrations' => array(
'CommerceKickstartBlogPost' => array(
'class_name' => 'CommerceKickstartBlogPost',
),
),
);
}
return array(
'api' => 2,
);
}
function commerce_kickstart_blog_commerce_kickstart_crumb_info() {
return array(
'taxonomy.termReference.field_blog_category.node.blog_post',
);
}
function commerce_kickstart_blog_preprocess_node(&$vars) {
if ($vars['type'] == 'blog_post') {
$vars['date'] = format_date($vars['created'], 'short');
if (array_key_exists('content', $vars)) {
$content =& $vars['content'];
if (array_key_exists('field_tags', $content)) {
foreach ($content['field_tags']['#items'] as $index => $info) {
$id = $info['tid'];
$content['field_tags'][$index]['#href'] = 'blog/tags/' . $id;
}
}
if (array_key_exists('field_blog_category', $content)) {
foreach ($content['field_blog_category']['#items'] as $index => $info) {
$id = $info['tid'];
$content['field_blog_category'][$index]['#href'] = 'blog/category/' . $id;
}
}
}
}
}