Services Tutorials and Examples

The following tutorials and examples will help get started with Services.

As time has gone on, many of these samples have fallen severely out of date. I have been attempting to re-classify them to the versions that are appropriate. If you encounter a sample that is version-specific, please edit and move it. If you find that a sample needs tweaks for a version, add that information into the comments and we'll roll it in or make new samples elsewhere.

If you are getting an Access Denied error when running these samples that is probably because finer access permissions were recently added in later versions.

For instance in the Flash 8 example, it loads a node. Using the latest Services (as at 29/5/08) you'll have to also check that 'load raw node data' under 'node_service module' is checked in your Access control for the example to work. Another thing to remember is a crossdomain.xml file in the root directory if your app is communicating with a remote site.

Examples of xml-rpc user.update drupal 7 services

Other possible things to check:

  1. A lot of these examples use the method node.load(), this has changed to node.get() in 1.x

HowTo: Add a Terms of Agreement on Registration Page

This is a quick and easy way to have users agree to a terms of service during registration using the profile.module. Ensure that the profile.module (part of core) is enabled, before beginning this recipe. Those looking for a module that does something similar should look to the legal.module. The "Terms of Use" module is another option.

Using Drupal 6.x:
______________________________

NOTE: See this node: http://drupal.org/node/179932 and look at #92 comment with a patch that fixes checkbox validation. Without this patch this trick does not work. This bug is present at in versions least up to 6.14. If you're not comfortable appying a core patch, use a contributed module as noted above or apply the following module to fix the core: http://drupal.org/project/checkbox_validate

Go to (administer > profiles)
Add a "checkbox" field, by clicking on the checkbox link under Add new field.

Now you are presented with a form, for the new profile field.
Fill out the form as follows (wording can be changed to suit your own use case)

Category: Terms Of Service (This will be the category under which the terms of service will be shown on the registration page)

Title: I Agree (Title of the checkbox itself)

Log in after disabling the user login block

If you disabled the User login block and need to log in, you can visit the login page on:

http://example.com/?q=user

or, if clean URLs are enabled, use

http://example.com/user

Note: Use the literal word user, not your username or user id.

Customization

You can completely customize the input form... first start by going to the /admin/settings/biblio page and clicking on "Fields" tab. On this page you can set parameters which are common to the fields across all publication types. If a field on this page is set to "common", it will appear on the input form of ALL publication types.

Basic usage

Upon installation the Biblio module creates submenus under three separate menu:

1. Content/Add Content (node/add/biblio)
2. Structure/Content Types (admin/structure/types/manage/biblio)
3. Configuration/Content Authoring/Biblio Settings (admin/config/content/biblio)

Adding a Biblio entry (node/add/biblio)

  • To add a new biblio entry, navigate to Create content > Biblio (/node/add/biblio).
  • Select the publication type. This can be changed later, if needed.
  • The form will reload with the options related to the publication type you chose in the previous step.
  • Fields marked with a "*" are required.

Configuration

Basic preferences

A number of settings are available at admin/settings/biblio (admin/config/content/biblio in 7.x). There, it is possible do the following:

Base URL
This sets the base URL used to access the biblio module (e.g. /biblio ).
Number of results per page.:
This sets the number of results that will be displayed per page.
Restrict users such that they can only view their own biblio entries
This option restricts the users capability to view biblio entries. They will only be able to see the entries which they have created and own.
Footnotes
You can integrate with the footnotes module here.
Integration with the footnotes module
Depends on: Footnotes (enabled)
This will convert <bib> tags into <fn> tags. This will cause intermingled <bib> and <fn> tags to be sequentially numbered. For this to work, you must put the <bib> filter ahead of the <fn> filter in the filter chain. If this option is not set, <bib> and <fn> tags will be handled separately.
OpenURL
You can set an openurl link here
OpenURL Base URL:

Pages

Subscribe with RSS Subscribe to RSS - Drupal 6.x