Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
By fever on
Hi
I have to show many text+image article in flash, like a "news section" that have the news article with the corrispondent image.
How can i do this with the amfphp.module?
I think about load the stories with get.view but how to load the correspond images, with cck?
The publisher that wrote the story trough drupal should attach the images in the story?
And how to order, from new to old the article loaded?
Thanks in advance
Fever
Comments
You are going to have to
You are going to have to write your own custom service to do this. Have you read the Services handbook?
Yes but i don't undestand
Yes but i don't undestand clearly what i have to do..
Have you watched the screen
Have you watched the screen casts? They were particularly helpful for me in understanding what was going on. I'm asking because it's pretty complex and I think Scott does a great job of explaining the concepts behind everything - a better job than I could do IMO, but if there is something specific about writing your service module that you don't understand then I can help you.
Yes watched the screencast
...with attention.
In the screencast the retrieval works because, before running the swf in the browser, you log in as admin.
My question is: can it work differently.
Can I allow someone else (possibly) anonymous to watch the recipe I uploaded?
My goal is to develop an app where the admin posts content (text, pics) and people (not admin) watch them.
thanks,
-c.
also
I noticed that I create new recipes on the client side with flash, but they don't show up in my recent posts. shouldn't they appear also there?
sorry
discovered right now that they are not published...sorry.
anyway the problem of accessing data with no previous login to me is crucial.
thanks in advance for any help you can provide.
Hi, Just give anonymous
Hi,
Just give anonymous users the right to access services under adminster>user management>access control.
Hope that helps.
We have never had to write
We have never had to write our own Service though. The bundled services that Scott Nelson wrote suit our needs just fine.
The approach that we've taken to tackle this problem is to use a combination of CCK (http://drupal.org/project/cck), Views (http://drupal.org/project/views), Imagefield (http://drupal.org/project/imagefield), and Amfphp/Services (http://drupal.org/project/amfphp | http://drupal.org/project/services). Be sure to follow the amfphp installation instructions with regard to installing amfphp 1.9.
We use clean urls, so this example also assumes that you have enabled them as well.
After installing all of the modules listed above, enable all of them in Administer/Site Building/Modules. Also enable Node Service and Views Service.
Then go to Administration/User Management/Access Control and enable "access services" for anonymous users. In Administer/Site Building/Services, turn off API key and Session Key.
Now create a new Content Type under Administer/Content Management/Content Types. For this example, the News Content Type will contain Title, Image, and Body fields. I've exported the the code for this example that you can load in if you are using Contemplate (http://drupal.org/project/contemplate).
Next, create a new view to load each news items into. I've called mine News just to keep things simple. Again, I've exported sample settings that you can import into the News view in order for this to work.
Save the view.
Now, in your menu select News under the Create Content link. Give the news item a title, upload an image, add the body, and save it. If you used the code above to import the News View, you should have a menu item called News. If you click there you should see your first news item posted there. We're half way done.
You can test the views.getView Service in the Services browser under Administer/Site Building/Services. In the view_name field, use the name that you gave your view. If you imported my view settings above, you would use news. When you click Call Method, it should return your news item. If it did, let's move on to the Flash side of this example.
Create a new Flash file and paste this code into the first frame:
Test the movie and your first news item should load into Flash.
Thanks
Thanks
$content[type] = array (
$content[type] = array (
'name' => 'News',
'type' => 'news',
'description' => '',
'title_label' => 'Title',
'body_label' => 'Body',
'min_word_count' => '0',
'help' => '',
'node_options' =>
array ( .........................................
Where i have to load this content? i have tried in the body and teaser, but when i post a news content with an image, this is show like ascii code and not like an image.
Title and description works, but image not.
>> In the view_name field, use the name that you gave your view. If you imported my view settings above, you would use news. When you >> click Call Method, it should return your news item. If it did, let's move on to the Flash side of this example.
In the service module i don'ts see "news" and than the flash file don't work.
Amfphp,clean url's and all the primary setting are ok.
Why?
Thanks
You have to use contemplate
You have to use contemplate to load that code.
Or
1. Create a new content type under Admin/Content management/Content types
2. Name:* "News"
3. Type:* "news"
4. Save it
5. Edit it
6. Add field
7. Give the field a name of "news_image"
8. Select Image for the Field Type
9. Save it