View-specific meta information not showing up

sgware - August 13, 2007 - 15:38
Project:Meta tags
Version:5.x-1.5
Component:Miscellaneous
Category:bug report
Priority:normal
Assigned:Unassigned
Status:duplicate
Description

Drupal 5 using latest version of all modules on Apache with clean URL's

The global meta information is showing up for me, but not the specifics. I set a description and some extra keywords on one of my views (taxonomy/$arg), but they do not show up. Only the global keywords show up. Any idea what might be causing this or how to fix it?

I'm using a custom template but there is a print($head) statement.

#1

urwas - August 17, 2007 - 22:06

Same problem for me... trying to use Robots-Tags for views, but they dont show up

#2

al.ex - September 29, 2007 - 13:00

me too..

#3

s560095 - October 10, 2007 - 10:00

I have exactly the same problem. Does anybody have a solution to this? PLEASE...

#4

davexoxide - October 28, 2007 - 23:50

I'm having the same issue as well.

#5

lamojo - December 4, 2007 - 18:59

i don't want google to index my views, but only the underlaying full nodes...

unfortunately i'm also experiencing above problem...

for now i solved my problem with a sloppy hack, replacing the "index,follow" in the $head parameter before printing it.

in page.tpl.php i changed

<?php print $head ?>

for

<?php
 
if (arg(0) == 'view' && arg(1) == 'some-list') {
   
$head = preg_replace('/"index,follow"/', '"noindex,follow"', $head);
  }
  print
$head
?>

to have google not index the view page www.examplesite.com/view/some-list where view/some-list is the views URL

#6

yelvington - December 4, 2007 - 19:21

Bingo. Same issue here. Same need. Thanks.

On a subsite, we need a homepage view that points to a load of individual pages. Do not want the homepage of that subsite to be indexed, but do want the links to be followed. Settings in meta tags configuration are not obeyed by the views component.

#7

yelvington - December 4, 2007 - 19:50
Category:support request» bug report

(Changing this from "support request" to "bug report."

I can see in the code where the default settings are applied if no override is retrieved, but I don't (yet?) see where/how settings specific to views are stored/retrieved, so I can't offer a patch.

WORKAROUND: Update your view to create a block. Make a blank page. Assign your block to the $content region. Edit the page's meta tags to NOINDEX, FOLLOW. Redefine that page as your homepage.

#8

Summit - December 5, 2007 - 22:07

Hi,
I have a similar question. I would like to NOT show my metatags on certain pages with have arg(0) = 'over'. I will fill the meta tags from the view.

How can I solve this with Preg_replace?
The following code I want to remove.
I tried

<?php
 
if (arg(0) == 'over') {
   
$head = preg_replace('<"meta name="keywords" content="gratis,informatie" '/>'", ', $head);
  
  }
  print
$head ?>

but it is not working. Can somebody please help?

thanks a lot in advance!

greetings,
Martijn

#9

al.ex - December 10, 2007 - 11:16

My problem was similar to sgware's, the specific meta tags didn't show up in views, but actually only on the frontpage, which is a view in my case.

Look at this code snippet:

function _nodewords_detect_type_and_ids() {
  if ($_GET['q'] == variable_get('site_frontpage', 'node')) {
    return array('type' => 'page', 'ids' => array(''));
  }

This helper functions assumes that the frontpage has to be a 'page' type, ignoring any alternatives like views. It sets the wrong type for the DB query and thus no meta tags for the view can be retrieved.

By commenting out this if clause, everything is working perfectly again for me. Maybe this can help others too..

-Alex

#10

Robrecht Jacques - August 12, 2008 - 07:40
Status:active» duplicate

Is the view problem still present in 5.x-1.9? I can't reproduce.

al.ex (#9): there is an option "Use front page meta tags" in 5.x-1.9 that overrides this.

Summit (#8): you may want to try http://drupal.org/project/nodewords_bypath.

Setting as duplicate of #202486: Meta Tags not saved for Views.

 
 

Drupal is a registered trademark of Dries Buytaert.