Hi all

I have a ECK entity setup with a bundle, a bit of logic in my module to output the page and data, works ok.

The problem is, when I view my bundle pages, no description is showing, and my titles change from the good page title I had, to 'view event'. All other node pages are ok, it's just the entity types I'm having trouble with. Been at this for hours.... :(

Anybody now what is going wrong, a known bug/fix working with entity types?

Thank you.

Barry

Comments

computerbarry created an issue. See original summary.

DamienMcKenna’s picture

Component: Code » Integration with other module

Are you just using the standard ECK handler to display the object, or are you using Panels, Views, etc?

computerbarry’s picture

Standard ECK handler to display the object, I think.

I created the entities in my ECK and displayed everything with code running from my global.module file, using:

function thisweek_block_global($setrange) {
  $query = new EntityFieldQuery();
  $query ->entityCondition('entity_type', 'events')
         ->entityCondition('bundle', 'event')
.....

foreach ($entites as $entity) {...

And just above this I have my hook menu to set up the page:

function global_menu() {
  $items['events'] = array(
    'title' => 'What\'s On',
    'type' => MENU_NORMAL_ITEM,
    'page callback' => 'global_events',
    'menu_name' => 'main-menu',
    'access arguments' => array('access content'),
  );
  return $items;
}

Any ideas, thanks.

I did read somewhere that we needed something like:

function global_entity_info() {
  array (
    'metatag' => TRUE
  );
}

Though after further reading of the change log, this was no longer needed?

DamienMcKenna’s picture

Are you trying to control the meta tags for the 'events' page, or the individual ECK object pages?

computerbarry’s picture

Good question!
Both, I think Damien, what do you suggest?

Thanks, Barry

DamienMcKenna’s picture

The two issues are different - one is "meta tags aren't loading for ECK entity pages", the other is "meta tags aren't being output on a custom page that has no Metatag integration." The first issue may be a case of configuration - check admin/config/search/metatags to see if your ECK entity type and its bundles are enabled. The second would need either some custom work or for you to use maybe Metatag:Context to define the meta tags for the custom page's path.

Out of interest, why didn't you use Views to build the events page? That way you could have used Metatag:Views for the events page's meta tags.

computerbarry’s picture

check admin/config/search/metatags to see if your ECK entity type and its bundles are enabled.

Yes I have checked this, both the entity type(Events) and bundle(Event) are visible and selected/ticked.

The second would need either some custom work or for you to use maybe Metatag:Context to define the meta tags for the custom page's path.

Some more code added to our modules code? And what is Metatag:Context, another module?

Out of interest, why didn't you use Views to build the events page? That way you could have used Metatag:Views for the events page's meta tags.

I know, something I did consider, I had already built the module before I started using metatags. I have been working on this code for months in my module and much easier to output the sort of data I need for my events, using month and date headers, adding rich snippets etc.

Barry

computerbarry’s picture

Don't believe it... been at this for over two night, I didn't realise I could 'Add a Metatag default' this let me add tokens for my Events/event bundle, works good now ha :)

Ok, so my single events pages are showing a description with correct titles, once I found the correct event tokens. That just leaves us with the events page, which has no description meta tag, any ideas on this Damien?

Barry

DamienMcKenna’s picture

Ok, cool, glad you got the ECK display sorted.

Metatag:Context is a submodule that comes with Metatag, it lets you control meta tags by path using the Context module, or you can just use the full Context UI and define meta tag reactions to any context definition.

computerbarry’s picture

Ok, cool, glad you got the ECK display sorted.

Thanks so am I :)
So we know that things do work with ECK and bundles, for anybody else having this problem.

I've managed to get things to work using what you suggested, though I needed to download the Context module, a little over kill for one pages description tag, though things do work, nice to know.

Ok, so I think that covers things Damien, unless you can think of anything further to add?

Thanks again, quick responses and sharing your knowledge.

Best,
Barry

DamienMcKenna’s picture

Status: Active » Fixed

You're welcome :)

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.