定制 kapelanmedien/km-eventnews-filter 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

kapelanmedien/km-eventnews-filter

最新稳定版本:2.0.0

Composer 安装命令:

composer require kapelanmedien/km-eventnews-filter

包简介

Filter event news by organizer, location, date, categories and tags

README 文档

README

This extension makes it possible to filter event news in the frontend by the following properties:

  • organizer
  • location
  • date from & to
  • categories
  • tags
  • sword

This extension is an adaption of EXT:news_filter

Requirements

  • TYPO3 12.4 or 13.4
  • EXT:news 12.x
  • EXT:eventnews 7.x

Usage

  1. Install the extension just as any other extension. Either use the Extension Manager or composer and composer require kapelanmedien/km-eventnews-filter.
  2. Select the action "list" in the news plugin and activate the additional checkbox "Enable filter"
  3. Select folders containing categories & tags.
  4. In order for filtering by organizer and location to work, the event restriction "Only events" must be selected.

TypoScript

The following TypoScript is required

plugin.tx_news.settings.demandClass = KapelanMedien\KmEventnewsFilter\Domain\Model\Dto\Demand

Templating

Add the following part to your List.html:

<f:form action="list" object="{extendedVariables.searchDemand}" name="search" class="news-search-form mb-3">
    <fieldset>
        <div class="mb-3">
            <label class="form-label" for="news-subject"><f:translate key="search-subject" /></label>
            <f:form.textfield id="news-subject" property="subject" class="form-control" />
        </div>

        <f:if condition="{extendedVariables.organizers}">
            <div class="mb-3">
                <label class="form-label" for="organizers"><f:translate key="organizers" extensionName="eventnews" /></label>
                <f:form.select
                        property="organizers"
                        id="organizers"
                        class="form-select"
                        options="{extendedVariables.organizers}"
                        optionValueField="uid"
                        optionLabelField="title"
                        multiple="multiple"
                    />
            </div>
        </f:if>
        <f:if condition="{extendedVariables.locations}">
            <div class="mb-3">
                <label class="form-label" for="locations"><f:translate key="locations" extensionName="eventnews" /></label>
                <f:form.select
                        property="locations"
                        id="locations"
                        class="form-select"
                        options="{extendedVariables.locations}"
                        optionValueField="uid"
                        optionLabelField="title"
                        multiple="multiple"
                    />
            </div>
        </f:if>
        <f:if condition="{extendedVariables.categories}">
            <div class="mb-3">
                <legend class="form-label"><f:translate key="categories" /></legend>
                <f:for each="{extendedVariables.categories}" as="category">
                    <div class="form-check form-check-inline">
                        <f:form.checkbox property="filteredCategories" value="{category.uid}" id="category_{category.uid}" class="form-check-input" />
                        <label class="form-check-label" for="category_{category.uid}">{category.title}</label>
                    </div>
                </f:for>
            </div>
        </f:if>
        <f:if condition="{extendedVariables.tags}">
            <div class="mb-3">
                <legend class="form-label"><f:translate key="tags" /></legend>
                <f:for each="{extendedVariables.tags}" as="tag">
                    <div class="form-check form-check-inline">
                        <f:form.checkbox property="filteredTags" value="{tag.uid}" id="tag_{tag.uid}" class="form-check-input" />
                        <label class="form-check-label" for="tag_{tag.uid}">{tag.title}</label>
                    </div>
                </f:for>
            </div>
        </f:if>

        <div class="mb-3">
            <label class="form-label" for="searchDateFrom"><f:translate key="search-date" /></label>
            <div class="input-group">
                <f:form.textfield type="date" class="form-control" id="searchDateFrom" property="searchDateFrom" />
                <label class="input-group-text" for="searchDateTo">-</label>
                <f:form.textfield type="date" class="form-control" id="searchDateTo" property="searchDateTo" />
            </div>
        </div>

        <f:form.submit value="{f:translate(key: 'search-start')}" class="btn btn-primary" />
    </fieldset>
</f:form>

Order categories, tags, organizers and locations

plugin.tx_news {
    settings {
        filterCategoriesOrderBy = title
        filterCategoriesOrderDirection = asc

        filterTagsOrderBy = title
        filterTagsOrderDirection = asc

        filterOrganizersOrderBy = title
        filterOrganizersOrderDirection = asc

        filterLocationsOrderBy = title
        filterLocationsOrderDirection = asc
    }
}

统计信息

  • 总下载量: 9
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 0
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 0
  • Watchers: 0
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: GPL-2.0-or-later
  • 更新时间: 2024-08-26