Skip to content
Grav 2.0 is officially stable. Read the announcement →
Archive

Event Plugin - Events View Isuue

Started by Muut Archive 10 years ago · 10 replies · 693 views
10 years ago

Looking into using Grav to replace a small existing Joomla Travel agent site. Existing site leverages a plugin made by developers to list tours. I am beginning to get my feet wet with development so I looked to the using the Grav Event plugin to get this functionality workings as I learn. For some reason the Event plugin is not listing events past the end of the year in Events view, it will however list this same event on the calendar view. When I adjust event to happen on 12/31/16 it get listed in Event view.

I am probably missing something, but the plugin seems very straightforward so unsure what I could be doing wrong. I am Still learning so I am open find to another way to do this.

10 years ago

Look at your template, if I'm correct, some template have a date range that is set to "endOfTheYear".

Maybe it could explain !

10 years ago

Thanks. I could not find the string you provided above after recursively searching for it in the root folder of my Grav setup, I also search for anything that matches *.year and did not find anything matching string. I am using the default theme Antimatter.

10 years ago

Have a look into user/plugins/events/templates/, you have templates within and their logic.

10 years ago

Looking at them now. I wonder if the following date ranges defined in file events.html.twig have anything to do with this issue.

TWIG

{# get events by taxonomy #}
{% set events =
    page.collection({
      'items': {
        '@taxonomy': {
          'type': 'event',
        }
      },
'dateRange': {
        'start': datetools.today|date('m/d/Y'),
        'end': datetools.parseDate('+1 month')|date('m/d/Y')
      },
      'order': {
        'by': 'date',
        'dir': 'asc'
      },
      'limit': 10,
      'pagination': true
    }) 
%}
---
10 years ago

Thanks for the nudge in the right direction. I just changed
---datetools.parseDate('+1 month')

TXT
to 
---datetools.parseDate('+12 month')

In file events.html.twig, My events are now showing up. I thought this was controlled by the plugins setting in the admin console.

10 years ago

Hi,

Glad it worked ; do not forget to put your custom templates in your templates directory so that when plugin is upgraded your changes are not lost !

10 years ago

Not sure where your are telling me to backup this file to. Seems everything has a template directory. This one was in a plugin folder.

10 years ago

You should always inherit your theme before customizing. That way your customizations aren't lost when things are updated. I'm pretty sure you just take the twig file from the plugin's templates folder and put it in your own theme's templates folder. That way you can update the plugin and not lose your changes.

10 years ago

Thanks. I am going to do the theme inherit process you have called out.

10 years ago

Followed the instructions linked but ran into issue on the last step with mytheme.php file. My baseline theme is Gravi-K. However error is presented "syntax error, unexpected '-', expecting '{'" . This is due to line below in the mytheme.php file. What is the right class name for Gravi-K theme? Also theme footer section is now gone, but am think ing this will be resolved with the class extension or copying the blueprint from Gravi-K theme.

TXT

class Mytheme extends gravi-k
---

Suggested topics

Topic Participants Replies Views Activity
Archive · by Deleted User, 9 years ago
0 1350 9 years ago
Archive · by Muut Archive, 9 years ago
2 935 9 years ago
Archive · by Muut Archive, 9 years ago
2 4061 9 years ago
Archive · by Muut Archive, 9 years ago
1 2948 9 years ago
Archive · by Muut Archive, 9 years ago
3 1119 9 years ago