Status message

Maintenant, vous regardez: Example for creating a custom module

Example for creating a custom module

There are two general categories of Drupal modules—core and contributed. Core modules are those
that are shipped with Drupal and include modules such as polls, menus, taxonomy, search, feed
aggregator, and forums. Contributed modules are all of the modules created by the community that
extend and enhance the functional footprint of Drupal core. There are literally thousands of contributed
modules available for download at http://drupal.org/project/modules.

1. Create a directory called docker within /sites/all/modules/custom directory
2. Now create three files
docker.info ,
docker.module
docker.output.inc
1).the basic information for the .info file will be:

  1. //docker.info
  2. name = Docker custom page
  3. description = Output Json format data of taxonomy query results.
  4. package = Docker
  5. core = 7.x
  6. version = 7.x-1.0

2). the basic information for the .module file will be:

  1. //docker.moudule
  2. /**
  3.  * Implements hook_menu().
  4.  */
  5. function docker_menu() {
  6. $rows = array();
  7. $rows['customer/%/%'] = array(
  8. 'title' => 'Customer',
  9. 'page callback' => 'docker_output',
  10. 'page arguments' => array(1, 2),
  11. 'access callback' => TRUE,
  12. 'type' => MENU_CALLBACK,
  13. 'file' => 'docker.output.inc'
  14. );
  15. return $rows;
  16. }

3) the basic information for the .inc file will be:

  1. //docker.output.inc
  2. function docker_output($tid1 = 0, $tid2 = 0) {
  3. $output = array();
  4. $q = new EntityFieldQuery();
  5. $q->entityCondition('entity_type', 'node')
  6. ->entityCondition('bundle', 'item')
  7. ->fieldCondition('field_taxonomy_1', 'tid', $tid1)
  8. ->fieldCondition('field_taxonomy_2', 'tid', $tid2);
  9. $result = $q->execute();
  10.  
  11. if (isset($result['node'])) {
  12. $nids = array_keys($result['node']);
  13. $nodes = entity_load('node', $nids);
  14. foreach ($nodes as $node) {
  15. $output[] = array(
  16. 'nid' => $node->nid,
  17. 'title' => $node->title,
  18. );
  19. }
  20. }
  21. echo json_encode($output);
  22. drupal_exit();
  23. }

Tags:

Comments

http://tribtaiti.webcindario.com/ how safe are canadian online pharmacies
northwest pharmacy canada http://tribtaiti.webcindario.com/
canada medications information http://tribtaiti.webcindario.com/

https://canadianhpharmacy.com/ canadian pharmacy viagra brand
canadianpharmacyusa24h https://canadianhpharmacy.com/
canadian online pharmacies legitimate https://canadianhpharmacy.com/

https://viagracwithoutdoctor.com/ canadian discount pharmacies in ocala fl
online canadian pharmacies https://viagracwithoutdoctor.com/
canada drug pharmacy https://viagracwithoutdoctor.com/

https://viagracwithoutdoctor.com/ canadian pharmacies online prescriptions
canadianpharmacy https://viagracwithoutdoctor.com/
are canadian online pharmacies safe https://viagracwithoutdoctor.com/

https://viagracwithoutdoctor.com/ canadian government approved pharmacies
best canadian pharmacies online https://viagracwithoutdoctor.com/
online pharmacies tech school https://viagracwithoutdoctor.com/

https://canadianhpharmacy.com/ online canadian discount pharmacies
drugs for sale https://canadianhpharmacy.com/
pharmacy onesource https://canadianhpharmacy.com/

https://viagracwithoutdoctor.com/ online pharmacies in usa
canadian pharmaceuticals https://viagracwithoutdoctor.com/
prescriptions from canada without https://viagracwithoutdoctor.com/

It's appropriate time to make a few plans for the longer term

and it is time to be happy. I've read this post and if I may just I

desire to suggest you some attention-grabbing things or suggestions.

Perhaps you can write subsequent articles relating to this article.

I want to read even more things about it!

my web site :: best website hosting

https://viagracwithoutdoctor.com/ online pharmacies of canada
canada online pharmacies for men https://viagracwithoutdoctor.com/
canadian medications list https://viagracwithoutdoctor.com/

https://canadianhpharmacy.com/ canadian pharmaceuticals stocks
drugstore online shopping reviews https://canadianhpharmacy.com/
top rated canadian pharmacies online https://canadianhpharmacy.com/

https://viagrawwithoutdoctor.com/ canadian government approved pharmacies
online pharmacies tech school https://viagrawwithoutdoctor.com/
canada drugs https://viagrawwithoutdoctor.com/

https://canadianhpharmacy.com/ drugs for sale in mexico
viagra canadiense https://canadianhpharmacy.com/
canadian government approved pharmacies https://canadianhpharmacy.com/

https://viagrawwithoutdoctor.com/ canadian prescriptions online
online pharmacy canada https://viagrawwithoutdoctor.com/
canada drug pharmacy https://viagrawwithoutdoctor.com/

https://viagracwithoutdoctor.com/ canadian pharcharmy online24
most reliable canadian pharmacies https://viagracwithoutdoctor.com/
north west pharmacies canada https://viagracwithoutdoctor.com/

https://viagracwithoutdoctor.com/ canada pharmaceuticals online
canadian pharmaceuticals stocks https://viagracwithoutdoctor.com/
no 1 canadian pharcharmy online https://viagracwithoutdoctor.com/

Hi there, I log on to your new stuff on a regular basis.

Your writing style is witty, keep it up! cheap flights 34pIoq5

https://viagracwithoutdoctor.com/ legitimate canadian mail order pharmacies
canadian pharmacy world https://viagracwithoutdoctor.com/
canadian pharcharmy online https://viagracwithoutdoctor.com/

https://viagrawwithoutdoctor.com/ discount canadian pharmacies
canadian discount pharmacies in ocala fl https://viagrawwithoutdoctor.com/
canadian pharmacy online 24 https://viagrawwithoutdoctor.com/

https://canadianhpharmacy.com/ canadian medications pharmacy
best canadian pharmacies online https://canadianhpharmacy.com/
online pharmacies mexico https://canadianhpharmacy.com/

https://viagracwithoutdoctor.com/ most reliable canadian online pharmacies
order canadian prescriptions online https://viagracwithoutdoctor.com/
canada medication prices https://viagracwithoutdoctor.com/

https://canadianhpharmacy.com/ canadian discount pharmacies in ocala fl
canadian discount pharmacies in ocala fl https://canadianhpharmacy.com/
canadian medications list https://canadianhpharmacy.com/

https://viagrawwithoutdoctor.com/ canadian rx world pharmacy
canadian pharcharmy online https://viagrawwithoutdoctor.com/
canada online pharmacies legitimate https://viagrawwithoutdoctor.com/

https://viagracwithoutdoctor.com/ online pharmacies mexico
online pharmacies in usa https://viagracwithoutdoctor.com/
canadian prescriptions online https://viagracwithoutdoctor.com/

If you wish for to improve your knowledge simply keep visiting

this website and be updated with the latest news posted here.

Feel free to visit my web blog: black mass

https://viagrawwithoutdoctor.com/ best canadian pharmacies online
canadian pharmacycanadian pharmacy https://viagrawwithoutdoctor.com/
how safe are canadian online pharmacies https://viagrawwithoutdoctor.com/

https://canadianlpharmacy.com/ canadian viagra
canadian prescriptions online https://canadianlpharmacy.com/
canadian pharmacies that ship to us https://canadianlpharmacy.com/

https://viagrawwithoutdoctor.com/ aarp recommended canadian online pharmacies
canadian medications 247 https://viagrawwithoutdoctor.com/
northwest pharmacies mail order https://viagrawwithoutdoctor.com/

Unquestionably consider that that you said.

Your favorite reason appeared to be at the internet the easiest factor to consider of.

I say to you, I definitely get irked at the same time as other folks consider concerns that they just don't realize about.

You managed to hit the nail upon the top and

also defined out the whole thing with no need side effect ,

other folks could take a signal. Will probably

be back to get more. Thanks

My web site: black mass

https://canadianhpharmacy.com/ canada pharmacies online prescriptions
online pharmacies of canada https://canadianhpharmacy.com/
drugs for sale deep web https://canadianhpharmacy.com/

Excellent article. I'm facing many of these issues as well..

Look into my blog: webhosting

https://viagracwithoutdoctor.com/ canada online pharmacies
canadian online pharmacy https://viagracwithoutdoctor.com/
canadian pharmaceuticals online https://viagracwithoutdoctor.com/

https://canadianhpharmacy.com/ canadian drugs
canadian prescriptions online serc 24 mg https://canadianhpharmacy.com/
canadian drugs https://canadianhpharmacy.com/

https://canadianlpharmacy.com/ is trust pharmacy in canada legitimate
drugs for sale online https://canadianlpharmacy.com/
drugstore online canada https://canadianlpharmacy.com/

https://canadianlpharmacy.com/ canada pharmacies
canadian online pharmacies legal https://canadianlpharmacy.com/
online pharmacy canada https://canadianlpharmacy.com/

https://viagrawwithoutdoctor.com/ canada online pharmacies for men
canada medication prices https://viagrawwithoutdoctor.com/
pharmacy canada online prescriptions https://viagrawwithoutdoctor.com/

Pages

Add new comment

Filtered HTML

  • Web page addresses and e-mail addresses turn into links automatically.
  • Allowed HTML tags: <a> <em> <strong> <cite> <blockquote> <code> <ul> <ol> <li> <dl> <dt> <dd>
  • Lines and paragraphs break automatically.

Plain text

  • No HTML tags allowed.
  • Web page addresses and e-mail addresses turn into links automatically.
  • Lines and paragraphs break automatically.
CAPTCHA
This question is for testing whether or not you are a human visitor and to prevent automated spam submissions.
17 + 2 =
Solve this simple math problem and enter the result. E.g. for 1+3, enter 4.