2

I am trying to develop a CiviCRM extension, and I have created a civiCRM extension (skeleton) using Totten\Civix.

In which directory should I put CiviCRM extension and how do I enable it in CiviCRM?

I have tried putting it in sites\default\files\civicrm\ext but when I go to Administer -> Extensions I caan't find it listed, when I click on Add New button nothing comes up.

CiviCRM is running in Drupal 7 and Drupal/CiviCRM are install on my local machine running WAMP.

I am new to this, any help will be appreciated

Emeka Mbah
  • 16,745
  • 10
  • 77
  • 96

2 Answers2

3

First, you have to define the extensions directory in CiviCRM -> Administer -> System settings -> Directory, item CiviCRM Extensions Directory

You should also define Extension Resource URL in CiviCRM -> Administer -> System settings -> Resource URLs so that some extensions can find the files they need (images, javascript, css files).

You can choose any path as long as there is the proper permissions (read/write access to www-data). CiviCRM create a /cache directory in order to retrieve information from extensions directory on CiviCRM servers and install new extensions from the UI. It's not required but it's useful while preparing your site.

(Please note that there is a stackexchange for CiviCRM specifically so you might want to ask your questions there : http://civicrm.stackexchange.com)

samuelsov
  • 395
  • 2
  • 10
  • Thanks a lot, This us helpful. I have alot of questions to ask. don't know if you can assist me. I just need directions. any civicrm extension tutorial you can recommend? – Emeka Mbah Feb 19 '16 at 14:41
  • 1
    You can start from https://wiki.civicrm.org/confluence/display/CRMDOC/Create+an+Extension and https://wiki.civicrm.org/confluence/display/CRMDOC/Create+a+Module+Extension. But if you don't know CiviCRM much, you will need to start with the api : go to https://yoursite.org/civicrm/api/explorer and start play with it (careful, it works and will do real changes to your data). – samuelsov Feb 19 '16 at 14:51
  • thanks for your help. just a quick one. just like we have many hooks in civicrm, is there any helpful methods I can call inside my extensions to accomplice a task, for example something like `get_user_pledges()` which will fetch an array of pledges by a certain user? – Emeka Mbah Feb 19 '16 at 15:00
  • 1
    You need to use the api for that - cf. yoursite.org/civicrm/api/explorer or https://github.com/civicrm/civicrm-core/tree/master/api/v3/examples (cf. Pledge). There are also some hook in CiviCRM, cf. https://wiki.civicrm.org/confluence/display/CRMDOC/Hook+Reference – samuelsov Feb 19 '16 at 15:13
  • can you look into this question http://civicrm.stackexchange.com/questions/9787/can-i-use-query-inside-civicrm-extension. No one seem to be visiting that channel – Emeka Mbah Feb 20 '16 at 20:09
-2

/sites/all/modules: Here you can put all your contrib and custom modules.

More details on Basic Directory Structure of a Drupal 7 Project

Augusto
  • 2,125
  • 18
  • 27
  • I was actually referring to a particular module called CiviCRM, it has its own extension directory inside Drupal. Thanks all the same – Emeka Mbah Feb 19 '16 at 10:27
  • This directory is only used to place the downloaded and custom modules in Drupal. This allows Drupal core to be updated without overwriting these files. – Mohd Belal May 01 '18 at 08:27