Hi UC,
I'm using your SortableDataObject::add_sortable_many_many_relation(). Everything is working great. My question concerns the use in a template.
On my page i need to order the DataObjects according the Value of the SortOrder. I managed to do just that, but i like to think there's a nicer way to do so.
right now i'm using a lot of if - loops to place my DO's in a table. Now this table has a lot of combined fields so i have to build the table step-by-step ( rowspans , it's a table for a pedigree);
----------------------------------------------------------
<table >
<% control Stamboom %>
<tr>
<td rowspan="4">
<% control StamboomPugs %>
<% if SortOrder = "0" %>
<% if Titel %>
<span class="champtitel">$Titel</span>
<% else %>
<span> </span>
<% end_if %>
<% end_if %>
<% end_control %>
</td>
<td rowspan="4">
<% control StamboomPugs %>
<% if SortOrder = "0" %>
$KennelNaam <br />
($Color)
<% end_if %>
<% end_control %>
</td>
<td rowspan="2">
<% control StamboomPugs %>
<% if SortOrder = "2" %>
<% if Titel %>
<span class="champtitel">$Titel</span>
<% else %>
<span> </span>
<% end_if %>
<% end_if %>
<% end_control %>
</td>
<td rowspan="2">
<% control StamboomPugs %>
<% if SortOrder = "2" %>
$KennelNaam <br /> ($Color)
<% end_if %>
<% end_control %>
</td>
<td >
<% control StamboomPugs %>
<% if SortOrder = "6" %>
<% if Titel %>
<span class="champtitel">$Titel</span>
<% else %>
<span> </span>
<% end_if %>
<% end_if %>
<% end_control %>
</td>
<td>
<% control StamboomPugs %>
<% if SortOrder = "6" %>
$KennelNaam <br /> ($Color)
<% end_if %>
<% end_control %>
--------------------------------------------------------------
etc. you get the idea
Is there a way to do such a thing in a nicer way?