1

1- I create a plugin with my hook :

function wordpress_civicrm_tabs( &$tabs, $contactID ) { // unset the contribition tab, i.e. remove it from the page //unset( $tabs[1] );

// let's add a new "contribution" tab with a different name and put it last
// this is just a demo, in the real world, you would create a url which would
// return an html snippet etc.

$url = CRM_Utils_System::url('civicrm/order',"reset=1&snippet=json&force=1&cid=$contactID" );
$tabs[] = array( 'id'    => 'orderTab',
                 'url'   => $url,
                 'title' => 'Orders',
                 'weight' => 1 );

}

With this function I added a new tab.

2- I enter in Administer/System Settings/Directory the location of my extension ..wp-content\plugins\ccbc_order_tab\ccbc.order\

3- I use civix to create my extension ccbc.order and in my folder I create a page:order

4.- My order.xml created in xml/Menu/order.xml it shows:

civicrm/order CRM_Order_Page_Order Order access CiviCRM

5- at the moment my page redirects to CRM/Contact/Dashboard.tpl.

Please can you help, what settings I missed?

Thank You

Nilda

  • Hi Nilda, you seem to be making some progress but having some difficult early steps like many others have had. You might want to review options for taking a developer training course in your area if there are any as a convenient way to get going. – Joe Murray Apr 14 '15 at 2:24
3

It appears you are confused about the difference between a CiviCRM Extension and a WordPress Plugin.

I would recommend you to write a native CiviCRM extension and enable it from the civicrm/administer page (you might need to set up the extension directory path first).

If you generate an extension with civix, it will take care of reading the xml to handle the url of the page you created and all the stuff you'd need to support your custom tab

-1

Have you done a clearcache (/civicrm/clearcache)?

  • My problem is doesn't read my order.xml and it is in the same directory as my tab implementation and redirect to different page. – Nilda Cervantes Apr 14 '15 at 15:14
  • I have XML file in my hook add new tab file to pass control to my extension's code, but doesn't work – Nilda Cervantes Apr 14 '15 at 17:04
  • @NildaCervantes my clearcache request is because CiviCRM needs it to update the callbacks so it know which page to call for which url? It happens to me every now and then that I forget this and then my new link does not work. If you did that and it still does not work there is another problem. – ErikH - CiviCooP Apr 15 '15 at 16:40

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.