Jump to:

10930 Posts in 2613 Topics by 1810 members

All other Modules

SilverStripe Forums » All other Modules » Event Calendar - displaying extra variables?

Discuss all other Modules here.

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

Page: 1
Go to End
Author Topic: 524 Views
  • borriej
    Avatar
    Community Member
    267 Posts

    Event Calendar - displaying extra variables? Link to this post

    Hello All,

    I've extended the event calendar module with two fields:

    class CalendarEvent extends Page
    {
       static $db = array (
          'Recursion' => 'Boolean',
          'CustomRecursionType' => 'Int',
          'DailyInterval' => 'Int',
          'WeeklyInterval' => 'Int',
          'MonthlyInterval' => 'Int',
          'MonthlyRecursionType1' => 'Int',
          'MonthlyRecursionType2' => 'Int',
          'MonthlyIndex' => 'Int',
          'MonthlyDayOfWeek' => 'Int',
          'Uitslag' => 'Text',
          'SoortWedstrijd' => 'Text'
          );
    ....

    So       'Uitslag' => 'Text',
          'SoortWedstrijd' => 'Text'

    are new fields.

    Now i want to display the upcomming events on my homepage:

    class Homepage_Controller extends Page_Controller {

       public function Events() {
          $today = date("Y-m-d");
          return DataObject::get_one("Calendar")->Events(null, $today, null, false, 5, null);
       }

    in the template i use:

                               <% control Events %>
                               
                                   <li>
                                      <h4>$EventTitle</h4>
                                      <span>$_Dates</span>
                                      <span>$SoortWedstrijd</span>
                                      <span>$Content</span>
                                   </li>
                               
                               <% end_control %>

    But $Content & $SoortWedstrijd aren't showing up on my homepage. EventTitle & Dates do show up.

    How do i fix this?

    Thx!

  • UncleCheese
    Avatar
    4085 Posts

    Re: Event Calendar - displaying extra variables? Link to this post

    $Event.CustomField

  • borriej
    Avatar
    Community Member
    267 Posts

    Re: Event Calendar - displaying extra variables? Link to this post

    And ofcourse, that worked, thanks Cheese

    <span>$Event.Content</span>

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