21288 Posts in 5733 Topics by 2602 members
|
Page:
1
|
Go to End | |
| Author | Topic: | 506 Views |
-
Creating a link

31 January 2010 at 4:55am
Hi, I have created a relational database to display a log of details. The details are quiet extensive so for the sake of displaying them I have this condensed table as you will see below. What I want to do is link from each row to a page of its own which displays the entry in its entirety.
I have not defined a function for $Link, this is the part I am having trouble with. Any ideas on how I do this? Thanks
<div class="typography">
<h2>$Title</h2>
<table>
<thead>
<tr>
<th>Date</th>
<th>First name</th>
<th>Surname</th>
<th>Gender</th>
<th>D.O.B.</th>
<th> </th>
</tr>
</thead>
<tbody>
<% if CallEvent %>
<% control CallEvent %>
<tr>
<td>$Created.Nice</td>
<td>$PersonDetail.FirstName</td>
<td>$PersonDetail.Surname</td>
<td>$PersonDetail.Gender</td>
<td>$PersonDetail.DateOfBirth.Nice</td>
<td><a href="$Link">Full details</a></td>
</tr>
<% end_control %>
<% else %>
<tr>
<td colspan="2">No records</td>
</tr>
<% end_if %>
</tbody>
</table> -
Re: Creating a link

31 January 2010 at 10:37am
You're in luck A Tutorial for this was posted this week on ssbits.com
http://www.ssbits.com/using-silverstripe-url-parameters-to-display-dataobjects-on-a-page/
-
Re: Creating a link

1 February 2010 at 1:35am
Zen Monkey you're the man! I'll be honest I've not seen anything like that after scouring the internet. I find SS bits really useful, the tutorials and snippets are very practical.
Thanks again
| 506 Views | ||
|
Page:
1
|
Go to Top |


