Jump to content

Robots meta data


antknight
 Share

Recommended Posts

I am trying to implement what I found here: http://clintonskakun...th-processwire/

but I get an error with the following code:

<meta type="robots" content="<?=($page->no_follow ? "nofollow" : "follow")?>,<?=$page->no_index ? "noindex" : "index")?>" />

Parse Error syntax error, unexpected ')', expecting ',' or ';' (line 22 of /home/anthonyj/public_html/site/templates/head.inc)

This error message was shown because you are logged in as a Superuser. Error has been logged.

Any help much appreciated

Link to comment
Share on other sites

You've got one extra ")" near the end of that row, right before last PHP end tag. Try this instead:

<meta type="robots" content="<?=($page->no_follow ? "nofollow" : "follow")?>,<?=$page->no_index ? "noindex" : "index"?>" />
Link to comment
Share on other sites

Thanks Teppo, that worked but does it need those brackets at all? I tried the following and it seemed to work fine:

<meta name="robots" content="<?=$page->no_follow ? "nofollow" : "follow"?>,<?=$page->no_index ? "noindex" : "index"?>" />
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...