1

What I try to achieve is create a simple Form where I will be able to add new content (like "Question" objects for instance) and access the information through Services 3.x. My problem is that I am new to Drupal and some guidance will be very helpful. I have tried to create a new custom content type, but as I need grouping of the fields, I used the "field collection" module. The problem there was that when using the node service I couldn't get the content of this field collection. So I am actually stuck now. The following questions appear in my head now:

  1. Do I need to write my own module to be able to extend the NODE object or I can achieve it by creating custom content type?
  2. Can I customize a service to return only desired properties (like only the id and the title of a node without returning all other properties like createddate, modifieddate, etc.) or should I create my own module to achieve this?
  3. If I need to create a custom module, can you point me to an example? (I have read the Drupal article for creating a resource for Services 3.x, but there they using a new custom object and not the NODE object)
  4. How can I have both a form to enter content and a service resource for the basic CRUD operations in one module? Using hooks?

Basically my point is to skip writing code for CRUD operations if it is possible and just use the ones from the NODE, but expose to the mobile app only some of the NODE properties and have a form where I can enter new content.

I am using Drupal 7.

I want to apologize for the messy post, but it really represents the thoughts in my head...

1

That's 4 questions in one ;-) For #2 checkout my previous question that has just been answered. Services Views would be another solution to do it without code.

0

though this is kinda old it might be interesting for a few. ive been using this excellent library https://github.com/jbeuckm/drupal-client that saves you tons of time as it handles the communication with a REST/Services enabled Drupal as a backend for a mobile app.

calling a view via the library, for instance, is a simple as

function loadView(view) {
    var viewName = view;
    var args ="";
    var headers ="";
    drupal.getView_custom(viewName, args, function(response) {
    Ti.API.info("response " + JSON.stringify(response));
    }, 
    function(error) {
    Ti.API.info("error " + JSON.stringify(error));
    }, headers);
};

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.