Create a Tab

From PGVWiki
Revision as of 20:22, 21 January 2011 by Daj (talk | contribs) (Updated to refelect 4.2.4 changes)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search


Create a New Tab on Individuals Page

(based on version 4.2.4 code base)


[Note: This article does not yet attempt to make the process easy for the beginner, but here are the basic steps involved. Advanced developers are invited to expand on this article!]

How to add tabs to the individuals page.

  • Locate individual_ctrl.php in the /includes/controllers directory of your PGV test site and create a backup of the original.
  • Edit individual_ctrl.php in your PHP editor of choice.
  • Add your new tab to the tabarray array around line 83 of individual_ctrl.php.
var $tabarray = array("facts"......
  • Save your changes to individual_ctrl.php.
  • Locate individual.php in the root of your PGV test site.
  • Because the tabs are handled through AJAX, you will need to alter the JavaScript in individual.php.
  • Add your tab to the tabid array around lines 242 AND 245.
  • Add another false to the loadedtabs array on lines below each of the above.
  • Add a "door" for your tab near line 407.
<dd id="door7">..... 
  • Add the HTML for your tab by copying the base template from one of the other tabs, for example the media tab
  • Upload individual_ctrl.php to the /includes/controllers directory of your PGV test site.
  • Test out the new tab.

External links