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:

Customising the CMS /

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

Readmore link problem when list of details

Go to End



Community Member, 57 Posts

25 June 2009 at 7:01pm

aram sir,

i wrote a code but this page $link not work so please suggest me.., al data fetch then show result but when page show with readmore link this link copy with "search" but i can't understand how to process or carry ID and behalf of this ID open related this data, so please sir help me..

<div class="typography">
<% if Menu(2) %>
<% include SideBar %>
<div id="Content">
<% end_if %>

<% if Level(2) %>
<% include BreadCrumbs %>
<% end_if %>


<% if Students %>

<h2>$FirstName </h2>test
<% control Students %>

<table border="0" cellpadding="0" cellspacing="0">

<p>$Date</p><p></p> <p>$Detail.LimitWordCountXML</p>
<a class="readMoreLink" href="$Link" title="Read more about &quot;{$Title}&quot;">Read more about &quot;{$EventName}&quot;...</a>

<% end_control %>

<% else %>
<p>There is no any student working with this mentor.</p>
<% end_if %>


<% if Menu(2) %>
<% end_if %>



class Mentor extends Page {

static $db = array(
'EventName' => 'Text',
'Date' => 'Date',
'Detail' => 'Text'

static $has_many = array(
'Students' => 'Student'

function getCMSFields() {
$fields = parent::getCMSFields();

$fields->addFieldToTab( 'Root.Content.Main', new TextField( 'EventName', 'Event Name' ) );
$fields->addFieldToTab( 'Root.Content.Main', new DateField( 'Date' ) );

$tablefield = new HasManyComplexTableField(
'EventName' => 'Event Name',
'Date' => 'Event Date',
'Detail' => 'Detail'
$tablefield->setAddTitle( 'A Student' );

$fields->addFieldToTab( 'Root.Content.Students', $tablefield );

return $fields;

function forTemplate() {
$template = 'GSOCPerson';
return $this->renderWith( $template );


class Mentor_Controller extends Page_Controller {