承接 wernerkrauss/folderperpage 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

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

wernerkrauss/folderperpage

Composer 安装命令:

composer require wernerkrauss/folderperpage

包简介

An extension for automatically creating a folder per page

README 文档

README

Build Status Scrutinizer Code Quality codecov.io helpfulrobot

Extension that creates a folder per page or dataobject

Requirements

for SS3 compatible versions see SS3 branch

Installation

Download and install manually or use composer.

Make sure you add the extension to the classes you want to decorate. Add this to your config.yml to add it to all Pages:

Page:
  extensions:
    - NetWerkstatt\FolderPerPage\Extensions\RootFolder

Configuration

You can exclude several page types. Just use the RootFolder.ignored_classes config value. The module's config.yml has some default values to get you started:

NetWerkstatt\FolderPerPage\Extensions\RootFolder:
  ignored_classes:
    - SilverStripe\CMS\Model\VirtualPage
    - SilverStripe\ErrorPage\ErrorPage
  create_folder_for_translations: false
  folder_root: 'Articles'

Of course every decorated class can have a seperate folder root, e.g. "Articles" for all pages and "News" for a news data object. Just add the folder_root config to your object.

Update your forms

You can use $this->getRootFoldername() to set the upload folder.

Given you have a has_one relation "Avatar" => "Image" you can add the folder to the UploadField:

function getCMSFields() {
    /*...*/
    $pic = UploadField::create('Avatar', 'Your Avatar');
    $fields->addFieldToTab('Root.Main', $pic);

    $pic->setFolderName($this->getRootFolderName());
    /*...*/
}

TODO

  • make it work for other dataobjects
  • unit tests
  • add function that automatically updates all UploadFields and BulkUploads to use this folder in a form
  • add support for subsites module, e.g. a master root per subsite
  • task for updating / checking all existing pages
  • check if page is moved
    • should it move the rootfolder automatically or by switch? May be a timeout problem with very large trees

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2014-05-16

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固