Skip to main content

This site requires you to update your browser. Your browsing experience maybe affected by not having the most up to date version.

We're retiring the forums!

The SilverStripe forums have passed their heyday. They'll stick around, but will be read only. We'd encourage you to get involved in the community via the following channels instead:

Archive /

Our old forums are still available as a read-only archive.

Moderators: martimiz, Sean, Ed, biapar, Willr, Ingo


Go to End

3 Posts   1743 Views


Community Member, 1 Post

15 January 2008 at 10:48pm


I'm building a website and need to pull stuff from a SOAP instead of a MySQL server. I'm kind of new to MVC but I figured I'll create a new pagetype and in there make a controller that will call my soap. And then in the .ss-file I'll call the controller.

<select name="category">
  	<% control getCategories($category) %>
  		<option value="$id">$name</option>
  	<% end_control %>

$category is the category for which I want subcategories. The structure can be explained like this:

In my DB I have my top-level categories. I create a page for each top-level category and choose which category the current page represents using a "HasOneComplexTableField", pretty much like in tutorial #5.
Then, depending on which category I'm on I'll call my getCategories-controller with the current category as an argument.

I have 2 problems with this.
1. How do I get the data from the SOAP into the template? Does the <% control getCategories($category) %> expect a DataObject to be returned or can it handle arrays as well?
2. When I try the code I've done I get an error, but <% control getCategories(1) %> works fine. Do I have to make a new function for each top-level category (getCategoriesForLevelOne, getCategoriesForLevelTwo, etc.) and then have those functions call the getCategories function with a hardcoded argument (1, 2, etc.)? That seems kind of stupid...

Please advise! :)

P.S. Why can't I preview this post before I post it?


Community Member, 156 Posts

12 June 2008 at 10:28am

Kabo, did you get anywhere with your SOAP stuff?


Community Member, 791 Posts

1 August 2008 at 9:24pm


Curious to hear about this as well....