Hi,

I'm creating a subtheme of Zen 3.
I'd like to change rel="nofollow" of comment title to dofollow.

I added this to my template.php:

function mytheme_preprocess_comment(&$variables, $hook) {
$variables['title_attributes_array']['rel'][] = 'dofollow';
}

Am I wrong ? This hasn't disable nofollow attribute :(

Thanks for help.

Comments

Similar issue

Regards,
Archi

Not really healpfull :( I

Not really healpfull :(
I tested it with this:

$variables['title_attributes_array']['rel'][] = '';

I've still nofollow on my links. Maybe my indexes pf $variables are wrong ?

-

Assuming that $title_attributes_array is expected and used, which I assume you have reason to believe, the correct action would most likely be
$variables['title_attributes_array']['rel'] = '';

By using the extra pair of brackets (meaning what you have been doing), you treat the rel attribute as an array and attempt to append a value to it, so that for instance if it was previously {'nofollow'} it would become {'nofollow', ''} (or {'nofollow', 'dofollow'} in the first case), but it doesn't make sense for it to be stored as an array in the first place, so most likely it's not. Since the behavior of an automatic conversion to array in php is undefined, the behavior of your command is (most likely) undefined as well. Good luck and happy hunting.

nobody click here