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.

Archive

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

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

Display Projects if Module - "DataObject Relationship Management"


Reply

779 Views

Avatar
Cy

23 October 2008 at 6:57am (Last edited: 23 October 2008 6:57pm), Community Member, 11 Posts

Much thanks to all the hard work in developing this beautiful framework/cms! So far, development has been relatively smooth with my first Silverstripe project.

In order to help clarify my question I'll use examples from the [url=http://doc.silverstripe.com/doku.php?id=tutorial:5-dataobject-relationship-management#displaying_the_data_on_your_website]Silverstripe tutorial (part 5)[/url].

Summary: I'd like a ProjectsHolder to filter by Modules a project contains.

Example:
1. A user visits the web site. The homepage shows a list of modules
2. The user clicks, lets say, the "Sapphire" module
3. The next page returns a list of all projects that include this module

Attempt for "gsoc-projects" template

<% control Children %>
<% if Modules == Sapphire %>
<tr>
<td>$Title</td>
<td>
<% if MyStudent %>
<% control MyStudent %>
$FirstName $Lastname
<% end_control %>
<% else %>
No Student
<% end_if %>
</td>
...
</tr>
<% end_if %>
<% end_control %>
...

Is it just a matter of adding an IF == [Module] clause under the <% control Children %>?

Also, would a better way be to pass the module name as a url parameter to just one projectHolder page that places the module name? How would this be done?

Thank you in advance for your help, ideas, and suggestions!

Cy

Update:
[url=http://www.silverstripe.com/site-builders-forum/flat/138462?start=0]Found this thread[/url] to be useful and I think will solve my problems.