help to better help you:
Please: add always Joomla / JEM version and details to your posts, so we can try to reproduce your issue!
Filtering and ordering day view when opening page
Filtering and ordering day view when opening page
3 years 8 months ago
I have someone who built an importer for our site. That is, It will load data from several external event websites via xml- and json-feeds, concert the data to JEM format, with the correct categories and venues.
My issue is twofold:
1. The data of one of my sources contains a huge amount of (separate) events in one category. It has an event for each movie and time on each day. This adds a huge amount of events, making it hard to find 'real' events of that day. Would it be possible to have a day view where you can specify which categories of events will be shown? So you can dismiss one or more categories.
2. The order of events is by default sorted by start date (dates) and start time (times). The issue with this is that i you have multiple events that last for a longer period of time, like exhibitions, these events will be shown at the top of the list every day, and, if you're out of luck, the 'real' events of that day might be shown on page 2.
I've done a core hack before, changing the stored in the db query, but that's not the way to love things.
I've tried something different in my template override: while looping through the events in the list, I dismiss the events with a start date older than today and then loop again through the array of events, showing only the 'old events'. Drawback is that this doesn't work if you have more events than the pagination. Since the original query has only the 25 or 50 events still sorted by oldest date first.
Have to solve this?
My issue is twofold:
1. The data of one of my sources contains a huge amount of (separate) events in one category. It has an event for each movie and time on each day. This adds a huge amount of events, making it hard to find 'real' events of that day. Would it be possible to have a day view where you can specify which categories of events will be shown? So you can dismiss one or more categories.
2. The order of events is by default sorted by start date (dates) and start time (times). The issue with this is that i you have multiple events that last for a longer period of time, like exhibitions, these events will be shown at the top of the list every day, and, if you're out of luck, the 'real' events of that day might be shown on page 2.
I've done a core hack before, changing the stored in the db query, but that's not the way to love things.
I've tried something different in my template override: while looping through the events in the list, I dismiss the events with a start date older than today and then loop again through the array of events, showing only the 'old events'. Drawback is that this doesn't work if you have more events than the pagination. Since the original query has only the 25 or 50 events still sorted by oldest date first.
Have to solve this?
Please Log in or Create an account to join the conversation.
Re: Filtering and ordering day view when opening page
3 years 8 months ago
In addition:
Is it possible to built a plugin for JEM that alters the query before it is sent to the database in the day view model?
Is it possible to built a plugin for JEM that alters the query before it is sent to the database in the day view model?
Please Log in or Create an account to join the conversation.
Re: Filtering and ordering day view when opening page
3 years 8 months ago
You could create a separate simplelist which uses only the special categories, so in the menu title the user have to decide, if they want films or "real" events.
Please Log in or Create an account to join the conversation.
Re: Filtering and ordering day view when opening page
3 years 8 months ago - 3 years 8 months ago
The problem with the simple list is that it selects all events starting from today, limited by the list limit in jem settings. I want to show only the events of today or a specific date. (It should work in conjunction with the calendar module.)
So actually the option to exclude a category, like in the simple list, would be nice to have in the day view.
So actually the option to exclude a category, like in the simple list, would be nice to have in the day view.
Last edit: 3 years 8 months ago by stevent.
Please Log in or Create an account to join the conversation.
Re: Filtering and ordering day view when opening page
3 years 8 months ago - 3 years 7 months ago
I've going through the code ov the simple list / event[strike]less[/strike]list.php model. Is a line of code suggesting there could be a restriction to the correct date.
But I can't find a setting for this. Then again, this won't work, since the calendar module links to the day view of JEM. So my day view will still be populated with categories you want to exclude.
What I would suggest is to have the same parameters in the day view as in the simple table view, so you not only can filter the day by category and featured items, but also have intro and footer text. (I now add modules on my eventlist pages to get a footer text)
Adding the category filter feature shouldn't be too hard. I would suggest adding the parameters of the eventlist view to the day view by adding these fields to the default.xml in com_jem/views/day/tmpl/
And in models/day.php (for filtering the category) after line 130:
Code:
$id .= ':' . $this->getState('filter.calendar_startdayonly');
But I can't find a setting for this. Then again, this won't work, since the calendar module links to the day view of JEM. So my day view will still be populated with categories you want to exclude.
What I would suggest is to have the same parameters in the day view as in the simple table view, so you not only can filter the day by category and featured items, but also have intro and footer text. (I now add modules on my eventlist pages to get a footer text)
Adding the category filter feature shouldn't be too hard. I would suggest adding the parameters of the eventlist view to the day view by adding these fields to the default.xml in com_jem/views/day/tmpl/
Code:
<field name="onlyfeatured" type="radio"
default="0"
label="COM_JEM_DISPLAY_FEATUREDONLY"
description="COM_JEM_DISPLAY_FEATUREDONLY_DESC"
class="btn-group btn-group-yesno"
>
<option value="1">JYES</option>
<option value="0">JNO</option>
</field>
<field type="spacer" name="spacer1" hr="true" />
<field name="introtext" type="textarea"
filter="safehtml"
default=""
rows="8"
cols="30"
label="COM_JEM_INTROTEXT_FIELD"
description="COM_JEM_INTROTEXT_FIELD_DESC"
/>
<field name="showintrotext" type="radio"
default="0"
label="COM_JEM_DISPLAY_INTROTEXT"
description="COM_JEM_DISPLAY_INTROTEXT_DESC"
class="btn-group btn-group-yesno"
>
<option value="1">JYES</option>
<option value="0">JNO</option>
</field>
<field type="spacer" name="spacer2" hr="true" />
<field name="categoryswitch" type="radio"
default="0"
label="COM_JEM_CATEGORYSWITCH"
description="COM_JEM_CATEGORYSWITCH_DESC"
class="btn-group btn-group-yesno"
>
<option value="1">COM_JEM_INCLUDE</option>
<option value="0">COM_JEM_EXCLUDE</option>
</field>
<field name="categoryswitchcats" type="text"
default=""
label="COM_JEM_CATEGORYSWITCHCATS"
description="COM_JEM_CATEGORYSWITCHCATS_DESC"
/>
<field type="spacer" name="spacer3" hr="true" />
<field name="footertext" type="footertext"
filter="safehtml"
default=""
rows="8"
cols="30"
label="COM_JEM_GLOBAL_FIELD_FOOTERTEXT"
description="COM_JEM_GLOBAL_FIELD_FOOTERTEXT_DESC"
/>
<field name="showfootertext" type="radio"
default="0"
label="COM_JEM_GLOBAL_FIELD_SHOW_FOOTERTEXT"
description="COM_JEM_GLOBAL_FIELD_SHOW_FOOTERTEXT_DESC"
class="btn-group btn-group-yesno"
>
<option value="1">JYES</option>
<option value="0">JNO</option>
</field>
And in models/day.php (for filtering the category) after line 130:
Code:
################################
## EXCLUDE/INCLUDE CATEGORIES ##
################################
$catswitch = $params->get('categoryswitch', '');
# set included categories
if ($catswitch) {
$included_cats = trim($params->get('categoryswitchcats', ''));
if ($included_cats) {
$included_cats = explode(",", $included_cats);
$this->setState('filter.category_id', $included_cats);
$this->setState('filter.category_id.include', true);
}
}
# set excluded categories
if (!$catswitch) {
$excluded_cats = trim($params->get('categoryswitchcats', ''));
if ($excluded_cats) {
$excluded_cats = explode(",", $excluded_cats);
$this->setState('filter.category_id', $excluded_cats);
$this->setState('filter.category_id.include', false);
}
}
// maybe top category is given by calendar view
$top_category = $app->input->getInt('topcat', 0);
if ($top_category > 0) { // accept 'root'
$children = JemCategories::getChilds($top_category);
if (count($children)) {
$where = 'rel.catid IN ('. implode(',', $children) .')';
$this->setState('filter.category_top', $where);
}
}
Last edit: 3 years 7 months ago by jojo12.
Please Log in or Create an account to join the conversation.
Re: Filtering and ordering day view when opening page
3 years 8 months ago - 3 years 8 months ago
you wrote:
EDIT: We've to add in views/day/tmpl/default.php and responsive/default.php the part for introtext and footer.
in normal day view this works.
But when coming from calender, this does not work. Why? There must be something between the calendar click and the day view for this special day.
EDIT2: In models/day.php there is in line 44 a notice, which talks about difference when coming from calendar module
There's no such file. You surely mean models/eventlist.php?I've going through the code ov the simple list / eventless.php model.
EDIT: We've to add in views/day/tmpl/default.php and responsive/default.php the part for introtext and footer.
in normal day view this works.
But when coming from calender, this does not work. Why? There must be something between the calendar click and the day view for this special day.
EDIT2: In models/day.php there is in line 44 a notice, which talks about difference when coming from calendar module
Last edit: 3 years 8 months ago by jojo12.
Please Log in or Create an account to join the conversation.
Time to create page: 0.505 seconds