Jump to:

5519 Posts in 1734 Topics by 1223 members

Customising the CMS

SilverStripe Forums » Customising the CMS » readMoreLink problem

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

Page: 1
Go to End
Author Topic: 589 Views
  • amarbhanu
    Avatar
    Community Member
    57 Posts

    readMoreLink problem Link to this post

    Uncle Cheese 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..

    mentor.ss

    <div class="typography">
       <% if Menu(2) %>
          <% include SideBar %>
          <div id="Content">
       <% end_if %>
             
       <% if Level(2) %>
           <% include BreadCrumbs %>
       <% end_if %>
       
          <h2>$Title</h2>
       
          $Content
             <% if Students %>
          
          <h2>$FirstName </h2>test
          <p>$Lastname
             <% control Students %>
          
          
       
          <table border="0" cellpadding="0" cellspacing="0">
             
                
                      <tr>
                         <td><h3>$EventName</h3>
                         <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>
    </li></td>
                         
                      </tr>
                   <% end_control %>
             
             </table>
          <% else %>
             <p>There is no any student working with this mentor.</p>
          <% end_if %>
          
          $Form
          $PageComments
       
       <% if Menu(2) %>
          </div>
       <% end_if %>
    </div>

    mentor.php

    <?php

    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(
             $this,
             'Students',
             'Student',
             array(
                'EventName' => 'Event Name',
                'Date' => 'Event Date',
                'Detail' => 'Detail'
             ),
             'getCMSFields_forPopup'
          );
          $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 {
       
       
    }

    ?>

       
       
       

    589 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.