Support for SermonSpeaker 5.x is in bugfix mode only, the same as it is for Joomla 3.10.
I will not add any new features to this releases.
Please upgrade to SermonSpeaker 6.x and Joomla 4.x, which is better anyway.

Filter

More
08 Oct 2014 09:16 #4887 by Phil Warburton
Filter was created by Phil Warburton
Hi

I would like to add speakers to the filter fields at the top of the sermon list. This is what I have tried adding to the default_filters.php file, but not successful.

<select name="Preacher" id="filter_preacher" class="input-small" onchange="this.form.submit()">
<option value="0"><?php echo JText::_('COM_SERMONSPEAKER_SELECT_PREACHER_SHORT'); ?></option>
<?php echo JHtml::_('select.options', $this->speaker_title, 'value', 'text', $this->state->get('titles.speaker'), true);?>
</select>

Please Log in or Create an account to join the conversation.

More
08 Oct 2014 10:12 #4888 by Thomas Hunziker
Replied by Thomas Hunziker on topic Filter
This would be a bit more complex to do and needs code change either in the sermons model or in the view.
The model actually is already capable of filtering by speakers as it is used in the single speaker view. But this filter is activated within the speaker view by setting the model state. See github.com/Bakual/SermonSpeaker/blob/mas...er/view.html.php#L92

I haven't included this filter (and series filter) in the sermons list because I think the UI gets to overloaded whith all those filter options. And you can already get a filtered list by series or speakers by just clicking on the name of the series/speaker.

If it's an important thing, I can add support for it in the model. Shouldn't be that hard actually.

Please Log in or Create an account to join the conversation.

More
09 Oct 2014 02:15 #4889 by Phil Warburton
Replied by Phil Warburton on topic Filter
Hi Thomas

My client is asking for it. I feel the same as you with the number of filters. Perhaps the filters could go vertically down the right hand side in future versions.

I guess it adds an ease of use for them. There is one main speaker so his name may be the only one that appears on that sermon landing page in the list of sermons. They may consider the option of dropping the month and year filters possibly.

Please Log in or Create an account to join the conversation.

More
09 Oct 2014 13:45 #4892 by Thomas Hunziker
Replied by Thomas Hunziker on topic Filter
I've added support for it to the sermons model.
You can try with the attached version:

File Attachment:

File Name: com_sermon...0-09.zip
File Size:3,409 KB


In the default_filters sublayout, you need to add this code to add the filters for speakers and series:
Code:
<select name="speaker" id="filter_speakers" class="input-medium" onchange="this.form.submit()"> <option value="0"><?php echo JText::_('COM_SERMONSPEAKER_SELECT_SPEAKER'); ?></option> <?php $db = JFactory::getDbo(); $query = $db->getQuery(true) ->select('`id`, `title`') ->from('`#__sermon_speakers`') ->where('`state` = 1'); $db->setQuery($query); $speakers = $db->loadAssocList(); echo JHtml::_('select.options', $speakers, 'id', 'title', $this->state->get('speaker.id'), true); ?> </select> <select name="serie" id="filter_series" class="input-medium" onchange="this.form.submit()"> <option value="0"><?php echo JText::_('COM_SERMONSPEAKER_SELECT_SERIES'); ?></option> <?php $query = $db->getQuery(true) ->select('`id`, `title`') ->from('`#__sermon_series`') ->where('`state` = 1'); $db->setQuery($query); $series = $db->loadAssocList(); echo JHtml::_('select.options', $series, 'id', 'title', $this->state->get('serie.id'), true); ?> </select>

This way you populate the dropdown directly from the database using a simple SQL query.
Attachments:

Please Log in or Create an account to join the conversation.

More
13 Oct 2014 06:30 #4897 by Phil Warburton
Replied by Phil Warburton on topic Filter
Thanks that works great, series filter is handy too.

Please Log in or Create an account to join the conversation.

Time to create page: 0.175 seconds
Powered by Kunena Forum