I'm not sure how much of #1151936: Ensure Metatag works OOTB using Views to display Drupal core's entities would apply to integrate with Panels, but this is a planned feature for the Meta tags module, so I'm making an early postponed issue for it.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

BenK’s picture

+1 Subscribing

alanburke’s picture

Subscribe [I've been giving the module a test - looking good so far on nodes]

elizarraraz’s picture

+1

bryancasler’s picture

subscribe

quantos’s picture

+1

7wonders’s picture

sub

Dave Reid’s picture

.

Dave Reid’s picture

Assigned: Unassigned » Dave Reid
Todd Young’s picture

Is there any way at all to have dynamically-generated page titles on Panels pages? I'm a-hurtin' without that feature...

Dave Reid’s picture

Sure, once its written and coded.

dropbydrop’s picture

+1

Todd Young’s picture

I'm sorry, I left the door open for mis-communication. I meant is there any way - through other modules, not necessarily just this one - to allow for Panels dynamic titles?

7wonders’s picture

Yes, using drupal_add_html_head it can be done. I had the need for forcing a specific image as the meta tag and did so like this - http://api.drupal.org/api/drupal/includes--common.inc/function/drupal_ad...

Todd Young’s picture

Hmm, I gave it a shot but it doesn't seem to override the currently-blank title tag that's already there, it instead adds a second one.

I went ahead with some down-n-dirty Javascript, for those interested:

$title = <<<EOL
%node:title
EOL;
$title=htmlspecialchars_decode($title, ENT_QUOTES);
print '<script type="text/javascript">document.title = "' . $title . ' | MySiteName"; </script>';
simonfunk’s picture

szb

bradhawkins’s picture

+1

xuanlang’s picture

Version: » 7.x-1.0-alpha2
Assigned: Dave Reid » Unassigned

Page title used hook_page_title_alter(), it work with panel and views.

function node_page_title_alter(&$title) {
  $menu_item = menu_get_item();
  // Test if this is a node page.
  if ( !strncmp($menu_item['path'], 'node/%', 6) &&
       ($node = menu_get_object()) &&
       !empty($node->page_title) &&
       variable_get('page_title_type_' . $node->type . '_showfield', 0)) {
    // If the node has a custom page title and the node type is configured
    // to have a custom page title (ie, it's not a leftover from a previous
    // setting), then use it.
    $title = $node->page_title;
  }
}

Meta_tags can used hook_meta_tags_alter()

Dave Reid’s picture

Version: 7.x-1.0-alpha2 »
Assigned: Unassigned » Dave Reid

Don't change the meta data again please.

zuzu83’s picture

it's a big problem not operate with panel

Dave Reid’s picture

seanhellwig’s picture

+1

mzwyssig’s picture

Subscribe.

I added a new field "Tags" (with a taxonomy term) to my content type. My content type is displayed with Panel Pages and I saw that within Panel pages I can add a relationship or a Context "term" or "vocabulary".

Do you think we can work with that ?

ben kuper’s picture

Sub

olax’s picture

+1

simonfunk’s picture

FileSize
1.93 KB

I have a solutions for it.
It is independed with this meta tags modul and works as an own modul.

It's still in a beta version but it works, so every improvements are welcome!

dimon00’s picture

I'm coming from post:
http://drupal.org/node/1289778

and I like to understand what integration with panels mean.

I have two types of nodes:
1. pages created with panels,
2. node with a modified template via panels.

With 1 meta tags seem working.
With 2 the tags are not overridden and I obtain empty tokens.

After some testing:
2 works only if the node contains a pane filled with element "content" set as "full content" and flagged as "panel title".

13rac1’s picture

Version: » 7.x-1.x-dev
Status: Postponed » Needs review
FileSize
4.48 KB

Attached is a patch for another part of Panels integration: Metatags for Custom Panel Pages. It adds a Meta tag tab to the Page edit, and Custom Panel Page as a metatag default. Additional work is probably needed for complete Panels integration, but this is an important step. Needs tests.

ymeiner’s picture

eosrei, great job! now we just have to figure out how to add contexts to the party.

Node panel pages with node contexts should have an indication about the node that is loading.

right now, when you are configuring a custom page, it does not have the node tokens. if we could add the node tokens and play with node content in the panel page description, all problems will be solved.

On the other hand, the better solution is to identify a page that has node in it's contexts as a node.

13rac1’s picture

Thanks ymeiner. I purposely added the metatag tab only to custom pages, because nodes already have their own metatag settings. I didn't want duplicate functionality. Is there a reason we need metatag settings for nodes in panels?

jenlampton’s picture

It would be good to clarify "Panel nodes" vs the "Node template" vs a custom panel with a specific "Node context" added to it.

@eosrei it seems reasonable that if a node context was added to a panel page, that we could pick up that node's meta tags and include them to the printed page, but I don't see a reason to add it to the UI...

unless, @ymeiner, you have a use-case where you need the node tokens to generate different meta tags than those on the node itself?

ymeiner’s picture

My problem is really simple.

I want the description to be with this pattern:

[node:title] is a [node:field_categories] in [node:field_location] reviewed by [node:author:field_first_name] [node:author:field_last_name] ([node:author:name]).

I use the Node template panel page. since the template is considered as a panel page, it doesn't show the content description. In my opinion it should.

13rac1’s picture

Metatag defaults for content types already are already at /admin/config/search/metatags. Just add a new default for your content type.

BenK’s picture

Status: Needs review » Needs work

I've tested the patch in #27 and can configure the Custom Panel Page as a metatag default (as well as metatag defaults for the content type).

But the main problem I'm experiencing is that Panels seems to override all metatags. Even though these custom metatags are specified in the metatag UI, they are not being output in the source code when actually viewing a panel.

To recreate:

1. Use the "Node template" panel to override the display of an "Article" node type.
2. Add a meta tag default for the "Article" content type.
3. Make some unique meta tags that you can search for when an article node is displayed.
4. Create and view an article node (which is being overridden by the panel you specified in Step #1). The custom meta tags are not being included in the source code.

--Ben

13rac1’s picture

@BenK This patch doesn't affect metatags for the Node Template panel, it only adds support for the Custom Panel Pages. I'll look into your issue next week though.

malberts’s picture

Status: Needs work » Needs review
Anonymous’s picture

I have a panel page overrideing node/%node. But the meta tags aren't coming through, not even the node defaults. The global metatags do come through.

-edit-
+1 for #33

ymeiner’s picture

#33 got to the point of the problem

mtrolle’s picture

+1 for #33

amitaibu’s picture

In order not to hijack this issue and regarding #33, here's a patch -- #1363476: Panels integration - ensure meta tags work OOTB on entity pages

Summit’s picture

Hi looking forward also for a term/%term solution next to custom and node panels template.
Greetings, Martijn

gillarf’s picture

This is great, thanks - but the 'title' tag is only appearing as meta data, not as the page title.

Site is: www.savepowerathome.co.uk

All my pages are custom panel pages.

mtrolle’s picture

#41 +1

xbrianx’s picture

subscribing.. Meta descriptions of content nodes are not showing when they are in panels

Anonymous’s picture

subscribing

jonathanmd’s picture

The patch at #27 worked for me.

cwithout’s picture

Status: Needs review » Needs work

Confirmed #41 & #42. Title is showing up as meta tag rather than page title. <meta name="title" content="My Page Title" />

Keywords and description work fine though.

edit : This result occurs with the #27 patch.

13rac1’s picture

@christinawithout You can already specify page titles in the current Panels UI. There is no reason to duplicate the functionality.

cwithout’s picture

@ehosrei If that functionality isn't needed, then it should be removed from the functionality added by this patch. Either way, the patch still needs work, because in the "Meta Tags" tab that it adds, there is a title field. The content of that title field shows up as a meta tag, which is something that shouldn't happen.

edit to clarify:
I confired that if you leave the title blank, the meta tag doesn't get in. But the default for Custom Panel Page is to inherit from Global. This is probably not the best choice.

Most users are not going to have the default for their Global meta tags be a blank title, and they're not going to assume they need to override the default. This means that when you open the Meta Tag tab from your panel, the Title field will be populated with the choices they have for Global meta tag. As a user, you're going to assume the module knows what it's doing, so to speak. You're not going to know instinctively that you should delete the title and rely on the method Panels uses to get the functionality.

The default for Custom Panel Page meta tags at least should be blank for title. That way there's less chance of people putting content there. But you still have the issue that it doesn't work as a user would expect if they enter something for title. Adding a title meta tag is not really a good outcome when that happens.

Unfortunately, there doesn't seem to be a way that I've seen to remove meta tag input fields for a specific type. They're always there even if you don't want a user to enter them. With that in mind, the best behavior is probably for a Meta Tag title entered to be able to override the title entered for Panels. While repetitive, it seems the more user-friendly of the options... unless someone can think of another way to make a repetitive field that doesn't work as expected more user-friendly.

DamienMcKenna’s picture

Checkout the work Dustin has already done on this: http://drupal.org/node/1210648 (sandbox)

aaron.r.carlton’s picture

+1 for #48. The Metatag project page advertises that the functionality from the old page_title module has been merged into this project. I understand that the primary purpose of that module was to be able to specify a 'page title' <title> for a page that is different from the title found in the markup <h1>. If that's the goal, I think that the Title field on the Panels' metatag form should replace the title in the header, not add a <meta name="title" ... /> tag.

Edit: fixed formatting.

aratike’s picture

Sub'd

ifish’s picture

sub

DamienMcKenna’s picture

Title: Integrate with Panels » Panels integration - meta discussion

Per discussions at the Drupalcon 2012 BOF I'm splitting this up into several tasks, some of which are priorities for a stable release, others not so. Lets use this ticket to decide the specific use cases which we'll create in other issues. I also think that Metatag shouldn't have to provide every single possibility, some of the use cases discussed during the BOF felt like they may be better off as submodules but we need to get a better understanding of them first.

The list currently looks like:

  1. #1363476: Panels integration - ensure meta tags work OOTB on entity pages
  2. #1498740: Panels integration - meta tags available on variant settings pages
  3. #1498732: Panels integration - mechanism to assign meta tags from variant content
  4. #1212072: Panels Meta

Are there any other use cases?

facal’s picture

In my opinion #1 is the real priority. Without it a website using page manager does not work properly.
Everything else is cool to have after #1 is achieved.

xbrianx’s picture

Still not being able to add custom meta descriptions for content in panels needs to get addressed for sure. Panels is used by many people.

ijujym’s picture

Subscribing

Michelle’s picture

@ijujym: Please use the "Follow" button at the top.

zerouno62’s picture

Since my home-page is made with panels it would be very important for me to have "Meta Tags" working with panels.

Many thanks in advance, Raffaele

ifish’s picture

Same here, my whole site is also built up with panels and havin this problem is critical for search engines.

Thanks in advance.

http://terrangaming.com

roeldl’s picture

Same issue over here.

Thanks in advance.

timebinder’s picture

Ok to confirm then, right now today Panel pages don't support metatags title and description?

nafmarcus’s picture

That is correct.
I was told that I should use hook_init and use the drupal_add_html_head($element, 'foo'); function.
The element looks something like this:

  $content = "This page is great and should show up really high in search results!";
  $element = array(
    '#tag' => 'meta',
    '#attributes' => array(
      'name' => 'description',
      'content' => $content,
    ),
  );

I'm using menu_get_item() to figure out which page i'm on.
Can't tell you if this is the "best" way but it seems to be working.

reysharks’s picture

Yeah, for sure this is not an elegant solution...

Still no word from the devs?

mattiasj’s picture

I agree that #1 is really of high priority. As people already stated, Panels is widely used to build sites and by that means suffer from good meta tools.

keesje’s picture

webmens’s picture

Subscribing

Michelle’s picture

@webmens: Please use the "Follow" button rather than leaving a comment.

DamienMcKenna’s picture

Status: Needs work » Fixed

I think we have enough direction to close this meta issue, lets handle individual tasks in the separate issues.

DamienMcKenna’s picture

Status: Fixed » Closed (fixed)
xbrianx’s picture

I just recently upgraded to the new version and tried to see if the meta description would be passed to panels, but it is not. Is there something I am missing for that?

xbrianx’s picture

I just recently upgraded to the new version and tried to see if the meta description would be passed to panels, but it is not. Is there something I am missing for that?

DamienMcKenna’s picture

@xbrianx: Please follow the discussion towards the end of #1363476: Panels integration - ensure meta tags work OOTB on entity pages

Cyclodex’s picture

Just searched for a solution regarding panels and meta tag. Now I found this module over here

just wanted to put this into here, due I am not sure if anyone knows that.
I tried out the sandbox (Dustin Bons's sandbox: Panels meta) too, (supports title with patch) but seems to have broken tokens or I missed something...
Anyway, now I came across this one, which I think makes a pretty nice and good integration.
Inlcuding Open Graph and browsable tokens just as in the metatag settings.

Not sure if the developers are aware of doing similar things (if so).
So give it a try, if you need metatag support in panels.

Hope this helps someone, I just nearly lost my mind when search and reading over all these issues regarding panels and metatag, lets see if this module solves some problems. (its pretty new, just 2 weeks old)