I'm trying to override existing registration list (in Registration tab) with my custom built view, however if I set my View's path to "node/%/registrations", the tab "Manage registrations" is gone from event(entity).

What should I do?

Comments

aucovic’s picture

In case someone is interested, I came up with a nice and simple solution. I'm implementing hook_menu_alter() and overriding tab's "page callback" so that my custom view is called instead built-in registration list. (Note that solution below covers only tab for NODE entity!)

    function MYMODULE_menu_alter(&$items){
    	$items['node/%entity_object/registrations']['page callback'] = 'regstrations_view';
    }
    
    function regstrations_view(){
    	$node = node_load(arg(1));
    	return views_embed_view('my_registration_list_view','page', $node->nid); 
    }

jenbrinn’s picture

I am a Drupal noob. Where would I stick this code to make this work?

Thanks in advance!

aucovic’s picture

@jenbrinn You need to create a module and paste that code in your module. Replace MYMODULE in the code with your's module name and of course edit views_embed_view parameters as well. If you do not know how to create a simple Drupal module search on Google, it is really simple.

jenbrinn’s picture

Ok, thanks. I don't know that I am ready to do that just yet. Is there another way to get the "manage registrations" page to show up again? I need a custom view so that I don't flash user emails to everyone, but I would like to also be able to actually manage the registrations.

Is creating a module the only way to do this?

aucovic’s picture

Even though it sounds scary, trust me it is very easy to create a simple module. You can build a custom module in less then a minute. You need one folder with one .info file and one .module file. Then all you need to do is copy the code above to the .module file.

Here is a simple step by step: http://www.cryptosmith.com/node/373

Note that my code is overriding existing registration list *in Registration tab*!

jenbrinn’s picture

Oh my goodness, I did it!

That's fantastic, thanks so much! (Yes, I'm a noob, but I'm getting there)

That guide was very helpful, thanks again!

(there should be a way to do this from within Entity Registration somehow, without need for a custom module, but at least it works now ) )

roball’s picture

Status: Active » Closed (duplicate)