定制 onedesign/autopop 二次开发

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

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

onedesign/autopop

Composer 安装命令:

composer require onedesign/autopop

包简介

Helps automatically populate entry content.

README 文档

README

Helps automatically populate entry content.

Requirements

This plugin requires Craft CMS 3.0.0-RC1 or later.

Installation

To install the plugin, follow these instructions.

  1. Open your terminal and go to your Craft project:

     cd /path/to/project
    
  2. Then tell Composer to load the plugin:

     composer require onedesign/autopop
    
  3. In the Control Panel, go to Settings → Plugins and click the “Install” button for Autopop.

Use

{# The initial entries to start with #}
{% set entries = craft.entries.section('news') %}

{# Returns an Element Query that includes all entries NOT in the `featuredNews` field for the passed `entry` #}
{% set populatedEntries = craft.autopop.entries({
  entries: entries,
  entry: entry,
  excludeFields: ['featuredNews']
}) %}

{# You can continue to refine this set by passing in additional arrays of entry `excludeIds` to exclude. #}
{% set populatedEntries = craft.autopop.entries({
  entries: populatedEntries,
  excludeIds: [5, 13]
}) %}

{# If you have an Entries field that may not have all of it's entries set, you can also easily "fill" all of the slots in that field. NOTE: You can't currently pass entries populated using autopop.fillField() through another autopop.entries(), because autopop.fillField() returns an Element Query with specific entry ids. Either make autopop.fillField() the last thing you pass entries through, or use in place of autopop.entries() #}
{% set filledEntries = craft.autopop.fillField({
  entries: populatedEntries,
  field: entry.featuredEntries,
  excludeIds: []
}) %}

Brought to you by One Design Company

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2018-03-02

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固