Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issue #2566869 by alexp999: Move hiding of taxonomy title to theme layer #202

Open
wants to merge 1 commit into
base: 7.x-2.x
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -84,16 +84,6 @@ function commerce_kickstart_block_block_view($delta = '') {
return $block;
}

/**
* Implements hook_preprocess_page().
*/
function commerce_kickstart_block_preprocess_page(&$variables) {
if (drupal_is_front_page()) {
// Remove the title from this page.
$variables['title'] = '';
}
}

/**
* Build an HTML element.
*
Expand Down
Original file line number Diff line number Diff line change
@@ -1,17 +1,5 @@
<?php

/**
* Implements hook_preprocess_page().
*/
function commerce_kickstart_taxonomy_preprocess_page(&$variables) {
// Remove collection_taxonomy_term view title.
$router_item = menu_get_item(current_path());
$machine_name = variable_get('commerce_kickstart_demo_store', FALSE) ? 'collection' : 'product_category';
if ($router_item['path'] == $machine_name . '/%') {
$variables['title'] = '';
}
}

/**
* Implements hook_taxonomy_menu_path().
*/
Expand Down
17 changes: 17 additions & 0 deletions themes/commerce_kickstart_theme/template.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,4 +37,21 @@ function commerce_kickstart_theme_preprocess_node(&$variables) {
if ($variables['type'] == 'blog_post') {
$variables['submitted'] = t('By') . ' ' . $variables['name'] . ', ' . $variables['date'];
}

if (drupal_is_front_page()) {
// Remove the title from this page.
$variables['title'] = '';
}
}

/**
* Implements hook_preprocess_page().
*/
function commerce_kickstart_theme_preprocess_page(&$variables) {
// Remove collection_taxonomy_term view title.
$router_item = menu_get_item(current_path());
$machine_name = variable_get('commerce_kickstart_demo_store', FALSE) ? 'collection' : 'product_category';
if ($router_item['path'] == $machine_name . '/%') {
$variables['title'] = '';
}
}