CiviCRM Community Forums (archive)

*

News:

Have a question about CiviCRM?
Get it answered quickly at the new
CiviCRM Stack Exchange Q+A site

This forum was archived on 25 November 2017. Learn more.
How to get involved.
What to do if you think you've found a bug.



  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Developer Discussion »
  • APIs and Hooks (Moderator: Donald Lobo) »
  • Using XML file to pass control to my extension's code from my new tab - Wordpres
Pages: [1]

Author Topic: Using XML file to pass control to my extension's code from my new tab - Wordpres  (Read 483 times)

Nilda

  • I’m new here
  • *
  • Posts: 12
  • Karma: 0
  • CiviCRM version: 4.5.8
  • CMS version: Wordpress 4.1
  • MySQL version: MySQL 6.2
  • PHP version: php 5.4
Using XML file to pass control to my extension's code from my new tab - Wordpres
April 14, 2015, 10:20:55 am
In administer/System Settings/ Directory -  I add my extension Directory

In administer/System Settings/Resource URLs - I add extension Resource URL.

I have my hook adding extra tab as a plugin, this works fine

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

I use civix to create my extension module in files/civicrm and I create a page.

now I have in my menu folder a XML file :

<?xml version="1.0"?>
<menu>
  <item>
    <path>civicrm/contact/view/order</path>
    <page_callback>CRM_Order_Page_Order</page_callback>
    <title>Order</title>
    <access_arguments>access CiviCRM</access_arguments>
  </item>
</menu>

This XML file was created with my extension module and I moved in the same directory as my hook, but doesn't work.

redirect to different page.

I don't know what I missed.

Thank You




« Last Edit: April 14, 2015, 10:28:46 am by Nilda »

totten

  • Administrator
  • Ask me questions
  • *****
  • Posts: 695
  • Karma: 64
Re: Using XML file to pass control to my extension's code from my new tab - Wordpres
April 14, 2015, 01:33:47 pm
1. Are you able to navigate to the page "civicrm/contact/view/order" directly (without tabs)?

2. Something that bit me a couple times -- I'd setup an extension, edit the code, and get confused because... I forgot to enable the extension.

3. Have you tried flushing the caches/rebuilding the menu (aka "civicrm/menu/rebuild" or "wp civicrm api system.flush")? http://civicrm.stackexchange.com/questions/93/what-are-the-different-caching-mechanisms-relevant-when-developing
« Last Edit: April 14, 2015, 04:29:47 pm by totten »

Nilda

  • I’m new here
  • *
  • Posts: 12
  • Karma: 0
  • CiviCRM version: 4.5.8
  • CMS version: Wordpress 4.1
  • MySQL version: MySQL 6.2
  • PHP version: php 5.4
Re: Using XML file to pass control to my extension's code from my new tab - Wordpres
April 15, 2015, 07:14:47 am
You are right I didn't enabled my extensions.  Now works fine

Thank you

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Developer Discussion »
  • APIs and Hooks (Moderator: Donald Lobo) »
  • Using XML file to pass control to my extension's code from my new tab - Wordpres

This forum was archived on 2017-11-26.