https://github.com/ashstevens-dev/drupal-8-custom-jokes-api-block-module
Drupal 8 Custom Module which creates a block that pulls in & outputs data from the Jokes API. Block allows control over number of jokes displayed.
https://github.com/ashstevens-dev/drupal-8-custom-jokes-api-block-module
api drupal-8 drupal-module drupal8 fetch-api javascript-api
Last synced: 4 months ago
JSON representation
Drupal 8 Custom Module which creates a block that pulls in & outputs data from the Jokes API. Block allows control over number of jokes displayed.
- Host: GitHub
- URL: https://github.com/ashstevens-dev/drupal-8-custom-jokes-api-block-module
- Owner: ashstevens-dev
- License: mit
- Created: 2020-11-13T01:16:28.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2020-11-13T01:54:31.000Z (over 5 years ago)
- Last Synced: 2025-10-06T06:49:13.077Z (4 months ago)
- Topics: api, drupal-8, drupal-module, drupal8, fetch-api, javascript-api
- Language: PHP
- Homepage:
- Size: 10.7 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# drupal-8-custom-jokes-api-block-module
Drupal 8 Custom Module which creates a block that pulls in and displays data from the Jokes API. The block allows you to control how many jokes you would like to display.
## Installation
Create a ``custom`` directory in the ``modules`` directory for your Drupal 8 website if you don't have one already. Place this ``jokes_api`` directory inside. Enable the module like you would any other module (it will show under ``Custom`` in the list on the modules page (Extend)).
## Configuration
Place the block in the region you'd like it to show - it will be called ``Jokes API block`` in the list. In the Output Limit field, type in how many jokes you would like to display in the block.
## :sparkles: Moving on
This is an example to show how you can create a simple custom module in Drupal 8 and how you can integrate an API's fetched data inside of a block. It can be easily expanded on and modified for other applications.