Hi, I am using Omega theme, Meta tags, path and pathauto modules, but my terms auto generated pages don’t show any Meta description. Even if I add manual description instead of available tokens, it doesn’t print that description in head section. I have updated the Metatag module to the latest version, but still not working.
Please help, thanks

Comments

damienmckenna’s picture

Status: Active » Postponed (maintainer needs more info)

Have you checked the instructions in the README.txt file? There are some tweaks that occasionally need to be done to get them to output. Do any meta tags show? What are you using to display the term pages - core's default pages, Views, Panels, etc?

fhdrupal’s picture

Thanks for response, using views to display contents for the auto generated terms path. The terms itself has Meta description option during creation, but doesn’t show it later.

kolier’s picture

I'm encountering the same issue. This patch would temporary fix, it works, but I'm not sure if it's following the best practice while I'm not familiar with the Ctools context.

kolier’s picture

Status: Postponed (maintainer needs more info) » Needs review

Change status.

kolier’s picture

Version: 7.x-1.0-beta7 » 7.x-1.x-dev

Change version to 7.x-1.x-dev.

fhdrupal’s picture

I put tried many Tokens for description is in global metatag settings, but still don't see description output in the header. I apply the patch given in #3, but it also did not work. Even I tried simple text without token, still can't see description. I am using omega sub-theme for e-commerce project. Thanks

kolier’s picture

This may only fix the metatag_panels.
Are you talking about views?
The potential problem maybe the $context->keyword shows "taxonomy_term", but the tokens functionality need to use "term" to identify.

damienmckenna’s picture

ignore that

fhdrupal’s picture

When I put token “[term:name] ” in the title box of the metatag module, it works. That mean it recognizes the term from the url. But doesn't pick up the description. Tried to changed to the dev version module, applied patch nothing works.

damienmckenna’s picture

Status: Needs review » Fixed

Committed! Thanks kolier.

Automatically closed -- issue fixed for 2 weeks with no activity.

kopeboy’s picture

Version: 7.x-1.x-dev » 7.x-1.0-beta9
Issue summary: View changes
Status: Closed (fixed) » Needs review

I'm using Metatag 7.x-1.0-beta9 and Views 7.x-3.8, new site building from scratch.
Configuration of said modules is default.

I enabled the provided View to override taxonomy/term/%
Metatag option in the View is "Using defaults".

All those taxonomy term pages now don't have the metatags. Not even the TITLE.
I only have: <meta name="description" content="A view to emulate Drupal core's handling of taxonomy/term.">

The site is multilingual and I'am using Translated taxonomy terms (x ID for each)

EDIT: I deleted the default Metatags FROM the view (now showing overridden), and all the default metatags defined in admin/config/search/metatag are now correctly provided.

Please add some instructions somewhere.. or fix this, because now I have to do this for every View page I create :(

damienmckenna’s picture

Version: 7.x-1.0-beta9 » 7.x-1.x-dev
Status: Needs review » Closed (fixed)

@kopeboy: I'm sorry you're running into these problems. Could you please open a new issue for this, as-is you're hijacking a closed issue. You might also try searching the issue queue for open tickets related to "views", there might be an existing issue for the problem you're seeing. Thanks.

webhippies’s picture

Sorry for posting and hijacking a closed issue but have to share the solution that worked for me.

I also deleted the default metatags from the view collection_products (Master, Page & Block) as kopeboy did at #12 and created a little module that i found out there http://drupal.stackexchange.com/a/146896

Hope this helps. I wasted a couple of hours searching.

/**
 * Implements hook_views_post_render().
 */
function MYMODULE_views_post_render(&$view, &$output, &$cache) {
  // Build a shortcut to the current display object.
  $display = $view->display[$view->current_display];

  // Only proceed if this view is a full page, don't process block or other
  // Views display objects.
  if ($view->name == 'MY_VIEW_NAME' && $display->display_plugin == 'page') {
    // Check if this is an entity display page, if so trigger
    // hook_entity_view().
    foreach (entity_get_info() as $entity_type => $entity_info) {
      // Entity paths will include an auto-loader that matches the entity's
      // name, thus the path will be 'some/path/%entity_name'.
      if (isset($entity_info['path']) && $entity_info['path'] == 'taxonomy/term/%taxonomy_term') {
        // Only proceed if this entity type supports meta tags.
        if (metatag_entity_supports_metatags($entity_type)) {
          // There must be at least one argument and the first argument must be
          // numerical.
          if (!empty($view->args) && is_numeric($view->args[0])) {
            // Only the first argument is used.
            $entities = entity_load($entity_type, array($view->args[0]));
            // Only if the entity actually exists.
            if (!empty($entities)) {
              $entity = array_pop($entities);
              MYMODULE_entity_view($entity, $entity_type, 'full', NULL, TRUE);
            }
          }
        }
      }
    }
  }
}



/**
 * Implements hook_entity_view().
 *
 * Provides additional argument to allow the display to be forced, to work
 * around problems elsewhere in the APIs.
 */
function MYMODULE_entity_view($entity, $entity_type, $view_mode, $langcode, $force = FALSE) {
  // Only run this function once per page load.
  static $i_will_say_this_only_once = FALSE;

  // Only proceed if this entity object is the page being viewed.
  if ($entity_type == 'taxonomy_term' && $view_mode == 'full') {
    // Some API calls need to force the data loading.
    if (!$force) {
      // Only run this function once per page load.
      if ($i_will_say_this_only_once) {
        return;
      }
      $i_will_say_this_only_once = TRUE;
    }

    // CTools uses 'page_manager' view mode to indicate the full entity display
    // page rather than 'full', so streamline the internal processes.
    if ($view_mode == 'page_manager') {
      $view_mode = 'full';
    }

    // Generate metatags output.
    if ($output = metatag_generate_entity_metatags($entity, $entity_type, $langcode, $view_mode)) {
      list($entity_id, $revision_id, $bundle) = entity_extract_ids($entity_type, $entity);
      $instance = "{$entity_type}:{$bundle}";
      // We need to register the term's metatags, so we can later fetch them.
      // @see metatag_page_build().
      metatag_page_set_metatags($instance, $output);
    }
  }
}
damienmckenna’s picture

Issue tags: -metatag
abhishek.pareek’s picture

Thanks kopeboy, for your helpful comment, solved my problem. :)

hevmills’s picture

I couldn't get #14 to work in Commerce Kickstart. I used dpm() the display $entity_info and found that there wasn't a $entity_info['path'] declared, but there was an $entity_info['default path']. Changing one line seems to have got this working for me:

Change:
if (isset($entity_info['path']) && $entity_info['path'] == 'taxonomy/term/%taxonomy_term') {

to

if (isset($entity_info['default path']) && $entity_info['default path'] == 'taxonomy/term/%taxonomy_term') {

I have no idea if this is correct, but it seems to be working here.