Jump to:

23493 Posts in 18996 Topics by 2878 members

General Questions

SilverStripe Forums » General Questions » Creating a link

General questions about getting started with SilverStripe that don't fit in any of the categories above.

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

Page: 1
Go to End
Author Topic: 627 Views
  • Harley
    Avatar
    Community Member
    153 Posts

    Creating a link Link to this post

    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>&nbsp;</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>

  • zenmonkey
    Avatar
    Community Member
    528 Posts

    Re: Creating a link Link to this post

    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/

  • Harley
    Avatar
    Community Member
    153 Posts

    Re: Creating a link Link to this post

    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

    627 Views
Page: 1
Go to Top

Want to know more about the company that brought you SilverStripe? Then check out SilverStripe.com

Comments on this website? Please give feedback.