mediadreams/md_newsfrontend 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

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

mediadreams/md_newsfrontend

最新稳定版本:5.0.4

Composer 安装命令:

composer require mediadreams/md_newsfrontend

包简介

This TYPO3 extension enables frontend users to created news records.

README 文档

README

This extension enables a frontend user to add ext:news-records. Beside adding content for the normal text fields like title, teaser, bodytext it is also possible to upload an image and a file download as well as selecting a category.

Templates are ready to use with the bootstrap framework and icons will be shown, if you have Font Awesome icon set included in your project. Validation of input is done in the frontend, rich text editing enabled for the textarea and a date picker in place for the archive date.

Requirements

  • TYPO3 ^12.4 || ^13.4
  • ext:news ^11.0 || ^12.0 || ^13.0 || ^14.0

Installation

  • Install the extension by using the extension manager or use composer
  • Include the static TypoScript of the extension
  • Configure the extension by setting your own constants

Usage

  • Add the pluign News frontend on a page, which is restricted by the frontend user login
  • Select a storage page in the plugin-tab in the field Record Storage Page
  • Now a frontend user is able to add, edit and delete own records

PSR-14 Events

Following PSR-14 events are available:

  • Mediadreams\MdNewsfrontend\Event\CreateActionBeforeSave: Called just before saving a new record
  • Mediadreams\MdNewsfrontend\Event\CreateActionAfterPersist: Called after a new record was saved (new record Id is available)
  • Mediadreams\MdNewsfrontend\Event\UpdateActionBeforeSave: Called just before an existig record will be updated
  • Mediadreams\MdNewsfrontend\Event\DeleteActionBeforeDelete: Called just before a record will be deleted

Register an event

Add following lines in Configuration/Services.yaml of your own extension:

services:
  Vendor\Extension\EventListener\MyListener:
    tags:
      - name: event.listener
        identifier: 'ext-mdnewsfrontend/createActionBeforeSaveEvent'
        method: 'enrichNews'
        event: Mediadreams\MdNewsfrontend\Event\CreateActionBeforeSaveEvent

Add the class Vendor\Extension\EventListener\MyListener with the method enrichNews in your extension:

namespace Vendor\Extension\EventListener;

use Mediadreams\MdNewsfrontend\Event\CreateActionBeforeSaveEvent;

final class MyListener
{
    public function enrichNews(CreateActionBeforeSaveEvent $obj)
    {
        // Get news object
        $news = $obj->getNews();
        $news->setTeaser('Set some teaser...');

        // Get NewsController
        $newsController = $obj->getNewsController();
    }
}

Bugs and Known Issues

If you find a bug, it would be nice if you add an issue on Github.

THANKS

Thanks a lot to all who make this outstanding TYPO3 project possible!

Credits

  • Extension icon was copied from ext:news and enriched with a pen from Font Awesome.
  • Thanks to Parsley.js, which I use for validating the form in the frontend.
  • Thanks to tiny, which I use as rich text editor in the frontend.
  • Thanks to flatpickr, which I use as date picker in the frontend.
  • And last but not least thanks to the guys at jQuery.

统计信息

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

GitHub 信息

  • Stars: 3
  • Watchers: 3
  • Forks: 6
  • 开发语言: JavaScript

其他信息

  • 授权协议: GPL-2.0-or-later
  • 更新时间: 2019-04-15