Jump to:

10929 Posts in 2613 Topics by 1809 members

All other Modules

SilverStripe Forums » All other Modules » Event Calendar - Upcoming Events Control

Discuss all other Modules here.

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

Page: 1 2 3
Go to End
Author Topic: 2807 Views
  • churika
    Avatar
    Community Member
    29 Posts

    Re: Event Calendar - Upcoming Events Control Link to this post

                   <ul style="margin: 0; padding: 0; width: 525px;">
                      <% control UpcomingEvents(4, events) %>
                          <li style="overflow: hidden; margin-bottom: 10px; height: 100px;">
                             <div class="eventleft" style="float: left; width: 150px;">
                                <a href="$Link">$ImageURL.SetWidth(125)</a>
                             </div>                        
                             <div class="eventright">
                                <a href="$Link">$Title</a><br />
                               <p>$_DatesText</p>
                                <p>$Content.LimitWordCount(15)</p>
                             </div>                            
                          </li>
                      <% end_control %>
                   </ul>

    $_DatesText is $_Dates function just renamed
    $ImageURL is a data object I added

  • UncleCheese
    Avatar
    4085 Posts

    Re: Event Calendar - Upcoming Events Control Link to this post

    If you're site isn't in dev mode. the URL debugging tools don't work, FYI..

  • churika
    Avatar
    Community Member
    29 Posts

    Re: Event Calendar - Upcoming Events Control Link to this post

    Director::set_dev_servers(array(
       'localhost',
       '127.0.0.1',
    ));

    That is turned on in _config.php

    Do i need to do something further to be in dev mode?

  • UncleCheese
    Avatar
    4085 Posts

    Re: Event Calendar - Upcoming Events Control Link to this post

    Director::set_environment_type('dev');

  • UncleCheese
    Avatar
    4085 Posts

    Re: Event Calendar - Upcoming Events Control Link to this post

    I don't think $Content is a valid field for a CalendarDateTime object. Make sure you're using the $Event accessor.

    $Event.Content, or use the shortcut $EventContent which has some smarts in it to get the content from the related event or the Description field if it's an announcement.

  • churika
    Avatar
    Community Member
    29 Posts

    Re: Event Calendar - Upcoming Events Control Link to this post

    Thx, using the Events. worked on both ImageURL and Content

    and the dev thing worked too i was able to see which one wasn't able to be accessed

    you're the man

  • Spiggley
    Avatar
    Community Member
    12 Posts

    Re: Event Calendar - Upcoming Events Control Link to this post

    I've just started using event Calendar and am impressed. If I am using $Event.Content within UpcomingEvents events, how can I use a word limit on this? as say $EventContent.LimitWordCount(10) doesn't work.

    Also, (and apologies if this has been asked before) - what is the best way to override calendar css? - as putting in my theme is not working.

    Sorry for the noob questions - with thanks

  • UncleCheese
    Avatar
    4085 Posts

    Re: Event Calendar - Upcoming Events Control Link to this post

    <% control Event %>
    $Content.LimitWordCount(10)
    <% end_control %>

    2807 Views
Page: 1 2 3
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.