Jump to:

10845 Posts in 2513 Topics by 1792 members

All other Modules

SilverStripe Forums » All other Modules » Calendar event module - upcoming events on homepage?

Discuss all other Modules here.

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

Page: 1 2 3 4 5
Go to End
Author Topic: 5624 Views
  • dreamstudio
    Avatar
    Community Member
    48 Posts

    Re: Calendar event module - upcoming events on homepage? Link to this post

    deleted old files... did a db flush then loaded new files and db flush again to be sure.... had the two files loaded with the code and still wont show anything up when i call the $CalendarWidget on a page

  • UncleCheese
    Avatar
    4085 Posts

    Re: Calendar event module - upcoming events on homepage? Link to this post

    Can you show me the template that is calling $CalendarWidget? Are you sure you're not in a control block when you're calling it? What happens if you change that function to just die('hello')? My guess is that it's not even reading that function, because at the very least you should get text that says "Loading..."

  • dreamstudio
    Avatar
    Community Member
    48 Posts

    Re: Calendar event module - upcoming events on homepage? Link to this post

    I put in die('hello')? and it put up just that text on the page

    I am attaching the file I put it in.. which is under the template directory.... page.ss I also tried it in numerous other locations ie layout/page.ss and even includes/sidebar.ss

    edit: it put the filename to page2.ss on here but its Page.ss on the website

    Attached Files
  • UncleCheese
    Avatar
    4085 Posts

    Re: Calendar event module - upcoming events on homepage? Link to this post

    Do you have a link to your website? There should at least be text that says "Loading" if the widget doesn't come up. When you view the source after the template has been rendered is there a <div id="calendar-widget"> where the calendar is supposed to be?

    That's just weird.. cause even if it didn't find the CalendarWidget class, you'd get a fatal php error.

    Try this..

    function CalendarWidget()
    {
    $c = new CalendarWidget(DataObject::get_one("Calendar"), null, null, true);
    return $c->forTemplate();
    }

    Might at least get an error that way.

  • dreamstudio
    Avatar
    Community Member
    48 Posts

    Re: Calendar event module - upcoming events on homepage? Link to this post

    replaced it with your updated code... no errors and nothing coming up... have a look at http://www.dgsmyourchoice.org.uk/about-us/

    Cant see a div id=calendar-widget bit either

  • FireMe!
    Avatar
    Community Member
    74 Posts

    Re: Calendar event module - upcoming events on homepage? Link to this post

    Hi UncleCheese

    I have got the upcoming events function working fine, but instead of having upcoming events i would rather it be Recent Events but i cannot get the function RecentEvents to work( i would like it to be the latest events rather than upcoming ones), any ideas?

    Thanks in Advance

    FireMe!

  • UncleCheese
    Avatar
    4085 Posts

    Re: Calendar event module - upcoming events on homepage? Link to this post

    Is return $your_calendar->RecentEvents(5) just returning an empty set?

  • FireMe!
    Avatar
    Community Member
    74 Posts

    Re: Calendar event module - upcoming events on homepage? Link to this post

    ive put,but does not to come back with any thing.

    Function RecentEvents()
    {
    return DataObject::get_one("Calendar")->RecentEvents(5);
    }

    5624 Views
Page: 1 2 3 4 5
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.