This project has moved. For the latest updates, please go here.

Problems with $macros.Head()

Jul 1, 2010 at 10:24 AM

I've setup a CMS site on http://www.cryogenesis.co.uk which is working fine, however for some reason the header files in the theme are all putting the line:

<meta name="robots" content="noindex,follow" />

as part of the $macros.Head() element

How do I get rid of this in the settings, or how do I replace it to put everything but the robots bit in, not sure how this ended up in there, but it's ruined their SEO and I need to sort this ASAP

Any help appreciated

Thanks, Andy

Coordinator
Jul 1, 2010 at 6:10 PM
Edited Jul 1, 2010 at 6:11 PM

Are you using categories with custom view files to create each page rather than making posts for each? If so that would explain this problem. Category pages are not indexed so that you dont have duplicate information showing up in separate hits on google, which would clutter up search results. Instead you could create a post with a custom view for each post. It should be fairly easy to fix, but I'm just guessing thats the problem.

As a quick fix you could try $macros.Head().replace("noindex","index") and it will render as <meta name="robots" content="index,follow" /> or something similar to wipe out that line.

I've always thought this didnt work quite right but usually found that every page is set to index even when it shouldnt be. Most categories on all my sites they still show up as index. Maybe because even my category pages have custom view files... not sure.

Jul 1, 2010 at 8:23 PM
Fantastic, it's a fudge but one that works - not sure why it was set this way, have resubmitted sitemaps etc, lets hope Google catches up!


From: [email removed]
To: [email removed]
Date: Thu, 1 Jul 2010 11:11:01 -0700
Subject: Re: Problems with $macros.Head() [graffiticms:217990]

From: jkillebrew
Are you using categories with custom view files to create each page rather than making posts for each? If so that would explain this problem. Category pages are not indexed so that you dont have duplicate information showing up in separate hits on google, which would clutter up search results. Instead you could create a post with a custom view for that one post. It should be fairly easy to fix, but I'm just guessing thats the problem.
As a quick fix you could try $macros.Head().replace("noindex","index") and it will render as <meta name="robots" content="index,follow" /> or something similar to wipe out that line.
I've always thought this didnt work quite right but usually found that every page is set to index even when it shouldnt be. Most categories on all my sites they still show up as index. Maybe because even my category pages have custom view files... not sure.
Read the full discussion online.
To add a post to this discussion, reply to this email (graffiticms@discussions.codeplex.com)
To start a new discussion for this project, email graffiticms@discussions.codeplex.com
You are receiving this email because you subscribed to this discussion on CodePlex. You can unsubscribe on CodePlex.com.
Please note: Images and attachments will be removed from emails. Any posts to this discussion will also be available online at CodePlex.com


Get a free e-mail account with Hotmail. Sign-up now.
Jul 22, 2010 at 6:56 PM
Edited Aug 24, 2010 at 7:58 PM

I know this is a little late but I have found this to be the best way to start your layout:

<head>
    <title>$title</title>
    $macros.MetaTags().Replace("noindex","index")
    $macros.RssAutodiscovery()
    $macros.RSD()
    $macros.Style("style.css","screen")
    <!--[if IE]>
        $macros.Style("base_ie.css","screen")
    <![endif]-->
    <script type="text/javascript" src="/includes/js/jquery-4.2.min.js"></script>
    $macros.JavaScript("scripts.js")
</head>

##Print out body classes for custom page styling
<body class="content-site #if($where=='home')home#else inner#end $url.Replace("/"," ")">

If you want to enable or disable the noindex then I suggest it is done with the category IDs in the theme or make a custom theme field where you can list them out and then create a macro in the theme which will pick them up and put them in an if statement. I have also experimented with using posts as categories or at least using parts of them but that gets very hairy and you need to define your IA first.