Results 1 to 8 of 8

Thread: getallevents

  1. #1
    New user
    Join Date
    10-03-10.
    Posts
    18

    Default getallevents

    I need some help, some idea of where to begin when implementing a "hook", specifically "getallevents". Basically how do I use it?!

  2. #2
    User
    Join Date
    01-20-11.
    Location
    Germany
    Posts
    77

    Default Re: getallevents

    Hi,

    do you want to use a hook offered by Contao or do you want to implement a hook inside an extension which can be used by other extensions. In the latter case please check the googlesitemap extension. It offers a hook which is used by the newssitemap extension.

    Jan
    Free support only here in the forum.
    Please report bugs for my extensions using http://www.contao-forge.org. Thanks!
    Requests for Contao support and development please send mail to jan@theofel.de

  3. #3
    New user
    Join Date
    10-03-10.
    Posts
    18

    Default Re: getallevents

    Hi,

    To be honest I don't know exactly.

    I guess want to use it within the Contao core, to have more control over which events are called into the event list in multiply instances. For example, I want to display tomorrow's events without also displaying today's events for several different "venues".

    I am using the calender_events_plus extension, so would any use of the "getallevents" hook in the Contao core be compatible with that extension?

    By using a hook do I need to build a custom extension?!

    Many thanks,

    Tim

  4. #4
    User
    Join Date
    01-20-11.
    Location
    Germany
    Posts
    77

    Default Re: getallevents

    Hello Tim,

    I don't know the calender_events_plus extension, but I can tell you how it should work with and without that extension:

    You don't need a hook here. All you need to do is hall the getAllEvents function. You can find an example how to do that in modules/calendar/ModuleCalendar.php (from line 210).

    The hook is available to change what this function returns, not to get the resuts.

    Jan
    Free support only here in the forum.
    Please report bugs for my extensions using http://www.contao-forge.org. Thanks!
    Requests for Contao support and development please send mail to jan@theofel.de

  5. #5
    New user
    Join Date
    10-03-10.
    Posts
    18

    Default Re: getallevents

    Hey Jan,

    Thanks for your help. It maybe looks/sounds like that the "getallevents" hook is not going to do what I thought it might...

    Do you know of any other way to display tomorrow's event, without also displaying today's? I had a look inside modules/calendar/events.php Line 354 onwards, and can see where the different options are for setting which periods it calls. It is fairly simple to set it to display the next two day's, but any ideas on how to display only tomorrow's events?

    BTW, my knowledge of php is fairly limited, although trying to learn...

    Thanks,

    Tim

  6. #6
    User
    Join Date
    01-20-11.
    Location
    Germany
    Posts
    77

    Default Re: getallevents

    Hello Tim,

    you should not do changes to the Contao core system as they will be gone after you install an update. And the regular Contao functions might not longer work.

    Please create a little extension on your own for this. I guess it is generally a goof idea to offer this logic in a more flexible way to all Contao users. It should offer two fields taking the same syntax as DataTime::add so you define "today", "today-tomorrow", "tomorrow", "the day after tomorrow", ...

    But I guess learning PHP by createing new Contao modules is not a good idea. But you might want to ask me (email: contao@theofel.com) or one of the Contao partners to write such a little extension for you.

    Jan

    PS: Please note that I won't be online and answer mails/posts here for the rest of the week.
    Free support only here in the forum.
    Please report bugs for my extensions using http://www.contao-forge.org. Thanks!
    Requests for Contao support and development please send mail to jan@theofel.de

  7. #7
    New user
    Join Date
    10-03-10.
    Posts
    18

    Default Re: getallevents

    Hi Jan,

    I really appreciate your help. I did wonder if it would come to that, building an extension I mean, and yes you're right I think learning php by building Contao modules is not a good idea. I will work around it for the time being, but will definitely consider contacting you as and when, as I will definitely want the flexibility plus a few other tweeks at some point.

    Again, many thanks,

    Tim

  8. #8
    New user
    Join Date
    10-03-10.
    Posts
    18

    Default Re: getallevents

    Jan,

    I really need to know whether you would be interested in building this extension for me otherwise I need to find someone else ASAP.

    Regards

    Tim

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •