Answers.Body: <p>The custom tab contains whatever's at the URL in the <code>url</code> parameter.  You can test it out by simply linking to another page on your site.</p>
  
  <p>Once you've confirmed that's working, you should generate a page with <code>civix generate:page</code>, and you can replace the <code>url</code> in your tab with that new page's URL.</p>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2015-12-11T01:15:17.140Z
Answers.Text: Please forgive that this may sound stupid...I'm not entirely sure how to use civix. I have it installed but an unsure how to follow the instructions on the wiki (http://wiki.civicrm.org/confluence/display/CRMDOC/Create+a+Module+Extension) I do have an extensions directory set up but have obviously done it wrong, can you A) give me a better idea of where the var folder should be in reference to the civix folder in my user folder and B) explain which part of the code in each of the section is usable and which part is explanation. It's a little daunting when you're new at command line
Answers.UserDisplayName: RayWright
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2015-12-10T22:16:10.710Z
Answers.LastActivityDate: 2015-12-10T22:16:10.710Z
Answers.UserDisplayName: Andie Hunt
Body: <p>I'm working on a hook to display a users PCPs on a custom contact tab. We use PCPs extensively and it would be great to see any pages the contact owns inside their contact card. (Rather than having to pull up the full list of PCPs in a separate window. I also know that there's a link to PCPs in the soft credit section of the contribution tab - but that's only if there is a contribution to the page.)</p>
  
  <p>I'm able to make a custom tab (using the tabset hook) but am struggling how to actually get content on to the tab.</p>
  
  <pre><code>// 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/contact/view/contribution',
                                "reset=1&amp;snippet=1&amp;force=1&amp;cid=$contactID" );
  // $url should return in 4.4 and prior an HTML snippet e.g. '&lt;div&gt;&lt;p&gt;....';
  // in 4.5 and higher this needs to be encoded in json. E.g. json_encode(array('content' =&gt; &lt;html form snippet as previously provided&gt;)); 
  // or CRM_Core_Page_AJAX::returnJsonResponse($content) where $content is the html code
  // in the first cases you need to echo the return and then exit, if you use CRM_Core_Page method you do not need to worry about this.
  $tabs[] = array( 'id'    =&gt; 'mySupercoolTab',
                   'url'   =&gt; $url,
                   'title' =&gt; 'Contribution Tab Renamed',
                   'weight' =&gt; 300 );
  </code></pre>
  
  <p>But I don't know what to set my own url to AND get content on it. I'm in Wordpress 4.3.1 and Civi 4.6.4. Suggestions?</p>
  
Tags: <hooks><pcp><contact-view>
Title: Content for Custom Tab
ThreadText: # Content for Custom Tab
  
  (Asked by: username_0 on 2015-12-10)
  
  I'm working on a hook to display a users PCPs on a custom contact tab. We use PCPs extensively and it would be great to see any pages the contact owns inside their contact card. (Rather than having to pull up the full list of PCPs in a separate window. I also know that there's a link to PCPs in the soft credit section of the contribution tab - but that's only if there is a contribution to the page.)
  
  I'm able to make a custom tab (using the tabset hook) but am struggling how to actually get content on to the tab.
  
  ```
  // 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/contact/view/contribution',
                                "reset=1&snippet=1&force=1&cid=$contactID" );
  // $url should return in 4.4 and prior an HTML snippet e.g. '<div><p>....';
  // in 4.5 and higher this needs to be encoded in json. E.g. json_encode(array('content' => <html form snippet as previously provided>)); 
  // or CRM_Core_Page_AJAX::returnJsonResponse($content) where $content is the html code
  // in the first cases you need to echo the return and then exit, if you use CRM_Core_Page method you do not need to worry about this.
  $tabs[] = array( 'id'    => 'mySupercoolTab',
                   'url'   => $url,
                   'title' => 'Contribution Tab Renamed',
                   'weight' => 300 );
  
  ```
  
  But I don't know what to set my own url to AND get content on it. I'm in Wordpress 4.3.1 and Civi 4.6.4. Suggestions?
  
  **Tags:** hooks, pcp, contact-view
  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_1 on 2015-12-10. Score: 1
  
  The custom tab contains whatever's at the URL in the `url` parameter. You can test it out by simply linking to another page on your site.
  
  Once you've confirmed that's working, you should generate a page with `civix generate:page`, and you can replace the `url` in your tab with that new page's URL.
  
  > **Comments:**
  > **username_0**: Please forgive that this may sound stupid...I'm not entirely sure how to use civix. I have it installed but an unsure how to follow the instructions on the wiki (http://wiki.civicrm.org/confluence/display/CRMDOC/Create+a+Module+Extension) I do have an extensions directory set up but have obviously done it wrong, can you A) give me a better idea of where the var folder should be in reference to the civix folder in my user folder and B) explain which part of the code in each of the section is usable and which part is explanation. It's a little daunting when you're new at command line  
  
  ---
  
  