I have used "Add a meta tag default" and choose 2 of my profiles from the drop down list. For each of these I put in test text for the title, keywords and description. Regardless of which theme I use, bartik, corporate clean or a custom theme none of the meta tags are changed even with clearing the cache (over and over).

I read http://drupal.org/node/1310780 and saw that in comment #5 Dave recommends including

<?php
render($content['metatags']);
?>

In my custom theme I tried putting this code in page--user.tpl.php and user--profile-category.tpl.php but still no meta tags.

I overrode the global defaults and added text for title, keywords and description. The keywords and description from the global set appear in the user profile pages but not the title. These global settings worked despite still having meta tag settings I set for my profile in place.

I can conclude that metatags is doing something with global keywords and description but not what it is suppose to do in the type profile and the title is always left out.

I tried one other thing, I added title, keywords and description to the type user and this changed the profile meta tags on the profile pages, /user/123, including the title.

I am using profile2 module. Does the meta tags module set the meta tags for profiles created with profile2? I would expect it to since the drop down list included my profile types.

Comments

Oceanman’s picture

Title: Title is not always set and type profile meta tags are set only by type global or type user. » Type Profile meta tags do not get assigned. They are set only by type global or type user.

I uninstalled Metatags and re enabled it. I now see that the type global mata tags including title, keywords and description all work on profiles and global mata tags are overrode by type user meta tags. This is the behavior I expect.

I used "Add a meta tag default" and added type Profile and type Profile:company. I set the Profile:all with meta tags (just text for tests) but the profiles kept the type user meta tags. The same type user meta tags are applied even when I have specified meta tags for type Profile:company.

I am not using pathauto. My user URL. mysite.com/user/xxx is being set to a new value, mysite.com/company/xxx, by the rules module after the user updates their profile data with content.

I have also tried to see if meta tags are assigned before the rules module adds an alias to the user URL and I only get the type user meta tags. I am not sure what else to try. Does anyone have this module working with the profile2 module?

Oceanman’s picture

Title: Type Profile meta tags do not get assigned. They are set only by type global or type user. » "Profile" meta tags not assigned

I see on my Profile edit page, found here: admin/structure/profiles/manage/myprofile/fields
a field called, "Meta tag module form elements." There is no Widget nor Operations links, therefore, I can not set these directly on this page. On this page: admin/config/search/metatags I can edit them on a default basis (which I have done).

The UI is there and I set the default tokens for the Profile meta tags but I have no meta tags on my profile pages.

Does anyone have this working correctly? I hope that someone could check if they can get this to work. Thanks.

dave reid’s picture

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

Confirmed that the metatag fieldset is not visible on profile2 entities. The problem here is that the order of form execution is:

metatag_form_alter()
profile2_form_user_profile_form_alter()
profile2_attach_form()
metatag_field_attach_form()

The order of execution should be:

profile2_form_user_profile_form_alter()
profile2_attach_form()
metatag_field_attach_form_alter()
metatag_form_alter()

The original problem here is that profile2 doesn't use its own form ID for editing profile entities, but instead piggy-backs on user_profile_form() to invoke field_attach_form().

Oceanman’s picture

Thanks Dave for taking a look.

With profile2 working the way it does, what has to be done to get these two modules to work seamlessly? Which module is the appropriate one to change?

damienmckenna’s picture

Status: Active » Postponed (maintainer needs more info)

Does this work now? The module was rewritten last year to use hook_entity_load instead of working off the field display, so at the very least it should be closer to working.

brei9000’s picture

This is still not working. I'm testing using a fresh install of Drupal with just Profile 2 7.x-1.3 and Metatag 7.x-1.0-beta7 enabled.

Media Crumb’s picture

So there is no way to get profile2 info into it? I'd love to have the authors real names show up. Surprised this hasn't come up a lot before.

konopko’s picture

Could you please fix this for non-separate page mode of Profile2?

damienmckenna’s picture

Title: "Profile" meta tags not assigned » "Profile" meta tags not assigned
Priority: Major » Normal
Status: Postponed (maintainer needs more info) » Active
damienmckenna’s picture

damienmckenna’s picture

Status: Active » Closed (duplicate)