1. Home
  2. Developers
  3. Action Hooks
  4. Adding Custom Tabs to Contact View or Company View

Adding Custom Tabs to Contact View or Company View

Developer Knowledge Required

This guide requires at least a basic understanding of PHP and WordPress development before you are able to add custom tabs via code.

This article explains how to add your own tabs programmatically to Zero BS CRM contacts and companies.

This is just one of many ways you can customise Zero BS CRM with code.

Example: Custom Tab on Contact Record:

 

Adding Custom Tabs to Contact View Vitals Tab area

As you can see in our Developer Code Examples, we’ve made this super easy.

To add your own tab to the Contact View ‘Vitals’ Tab area, you need to simply add a function which adds your tab to our array of tabs. This is fairly easy to achieve with WordPress filters.

We’ve created you a custom bare-bones plugin file which you can download from the Developer Code examples, or copy from the following snippet.

To get this working:

  1. Copy the code into a new php file (e.g. yourCustomTabsName.php)
  2. Edit the file to put in your own content HTML & title for the tab etc.
  3. Save this file, and then compress it into a zip file (e.g. yourCustomTabsName.zip)
  4. Upload this zip file as you would any normal WordPress plugin
  5. You should now see your new custom tab in place on any Contact View.
  6. … you can now edit this php file and re-upload it to achieve your desired extra tab.

 

Here’s the php file, which you can also find in our Developer Code Examples on github:

Adding Custom Tabs to Company View Vitals Tab area

If you would like to add a custom tab to company view, the process is the same as above, only the filter name is slightly different:

Here’s the php file, which you can also find in our Developer Code Examples on github:

The WordPress Filter

If you’re familiar with WordPress filters, here the filters we’re using are:

zbs-contact-vital-tabs

and

zbs-company-vital-tabs

These need to be added as any other WordPress filter, for example: (Note the priority & argument count parameters at the end – these are required.)

add_filter( ‘zbs-contact-vital-tabs’, ‘yourFunctionName’, 10, 2);

And from the above developer examples, here’s a function example:

Updated on April 18, 2018

Was this article helpful?

Related Articles

Still not found an answer?
If you've searched the knowledge base and still can't find a solution, please submit a ticket.
CONTACT SUPPORT

Comments

  1. How for show custom fields ?

    ‘content’ => ‘The Company ID is: ‘.$id.”

    1. For custom fields, you’d get the contact info first using $contactInfo = zeroBS_getCustomer($id); and then printing out the fields you nee from the $contactInfo array.

Reply to Michel Cancel

This site uses Akismet to reduce spam. Learn how your comment data is processed.