Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/signalpoint/jDrupal
A JavaScript Library and API for Drupal Applications
https://github.com/signalpoint/jDrupal
drupal javascript mobile-app web-app
Last synced: 11 days ago
JSON representation
A JavaScript Library and API for Drupal Applications
- Host: GitHub
- URL: https://github.com/signalpoint/jDrupal
- Owner: signalpoint
- License: gpl-2.0
- Created: 2013-12-30T17:51:52.000Z (about 11 years ago)
- Default Branch: 8.x-1.x
- Last Pushed: 2022-06-07T14:25:56.000Z (over 2 years ago)
- Last Synced: 2025-01-10T18:51:36.385Z (24 days ago)
- Topics: drupal, javascript, mobile-app, web-app
- Language: JavaScript
- Homepage: http://jdrupal.tylerfrankenstein.com/
- Size: 1.15 MB
- Stars: 76
- Watchers: 8
- Forks: 38
- Open Issues: 27
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.txt
- License: LICENSE.txt
Awesome Lists containing this project
README
## What is jDrupal?
> A simple Vanilla JavaScript Library and API.
## What is jDrupal used for?
> Drupal 8 Application Development.
## What kind of apps?
> A variety of application architectures, including...
- Mobile Applications (Android, iOS, etc)
- Web Applications
- Headless Drupal / Decoupled Drupal
- [PhoneGap](http://phonegap.com/) ([Cordova](https://cordova.apache.org/))## jDrupal...
- solves many common development needs for Drupal based applications.
- provides a familiar Drupal coding experience and syntax for developers.
- runs alongside any frontend client side framework, or with no framework at all.
- utilizes JavaScript prototypes and promises.Since jDrupal has no dependencies and is written in pure JavaScript, it can be used in a wide variety of architectures and frameworks. Just include it in the `` of your app's `index.html` file:
```
```
## Quick Examples
```
// Connect to Drupal and say hello to the current user.
jDrupal.connect().then(function() {
var user = jDrupal.currentUser();
var msg = user.isAuthenticated() ?
'Hello ' + user.getAccountName() : 'Hello World';
alert(msg);
});
``````
// Load a node and display the title.
jDrupal.nodeLoad(123).then(function(node) {
alert(node.getTitle());
});
``````
// Login and show the user their id.
jDrupal.userLogin('bob', 'secret').then(function() {
alert(jDrupal.currentUser().id());
});
``````
// Get results from a view and print the node ids to the console.
jDrupal.viewsLoad('my-view-url').then(function(view) {
var results = view.getResults();
for (var i = 0; i < results.length; i ++) {
var node = new jDrupal.Node(results[i]);
console.log('node id: ' + node.id());
}
});
```## Getting Started
- [Hello World](http://jdrupal.tylerfrankenstein.com/8/docs/Hello_World)
> jDrupal is best friends with [DrupalGap](http://drupalgap.org), the open source application development kit for Drupal websites.
## Cordova + iOS
If you're developing an iOS app using cordova, follow [these additional instructions](https://github.com/signalpoint/jDrupal/issues/87#issuecomment-775488402).