homm/hommsocialfeed 问题修复 & 功能扩展

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

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

homm/hommsocialfeed

Composer 安装命令:

composer require homm/hommsocialfeed

包简介

Craft CMS Social Feed Adapter for juicer.io

README 文档

README

HOMM Social Feed Adapter for Juicer

Screenshot

Requirements

This plugin requires Craft CMS 4.x.

For the Craft CMS 3.x plugin version, see 1.x tags.

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 homm/hommsocialfeed
    
  3. In the Control Panel, go to Settings → Plugins and click the “Install” button for HOMM Social Feed.

HOMM Social Feed Overview

HOMM Social Feed is a Craft adapter for juicer.io to collect all of your social media feeds for easy integration in your application.

Configuring HOMM Social Feed

Go to Settings > HOMM Social Feed to setup the basic configuration options:

  • Social Feed API path: The path to your Juicer API (for example: https://www.juicer.io/api/feeds/artdecohotelmontana)
  • Number of Posts: The amount of posts to query by default
  • Colors: The available colors you can set per feed. These values are only used for the CP section. In the query you retrieve the handles dark, highlight and muted.

Add the following CronJob, to regularly update your social feeds:

/path/to/your/project/craft hommsocialfeed/social-feeds/update

Using HOMM Social Feed

Select HOMM Social Feed in the left navigation.

You can set following properties:

  • Status: Disable or enable specific posts
  • Color: Change or reset the color for specific posts
  • Hide image/video: Hide the image or video for specific posts

Basic usage in the template (Twig):

{% for socialFeed in craft.socialFeed.all() %}
    <img src="{{ socialFeed.image }}" alt="{{ socialFeed.message|slice(0, 10) }}" loading="lazy">
{% endfor %}

More complex example in the template (Twig):

{# Query all posts which has an image and the image is not hidden #}
{% for socialFeed in craft.socialFeed.all([{ isMediaHidden: false }, ['not', { image: null }]]) %}
    <div class="{{ socialFeed.color }}">
        {% if not socialFeed.isMediaHidden %}
            {% if socialFeed.video is not empty %}
                <div class="img">
                    <video class="video" controls poster="{{ socialFeed.image }}">
                        <source src="{{ socialFeed.video }}" type="video/mp4">
                    </video>
                </div>
            {% elseif socialFeed.image is not empty %}
                <a href="{{ socialFeed.feedUrl }}" title="{{ readMore }}" target="_blank">
                    <img src="{{ socialFeed.image }}" alt="{{ socialFeed.message|slice(0, 10) }}" loading="lazy">
                    <span>                             
                        {{ socialFeed.feedDateCreated|date('long') }}
                    </span>
                </a>
                {% for additionalPhoto in socialFeed.additionalPhotos|json_decode %}
                    <img src="additionalPhoto" alt="{{ socialFeed.message|slice(0, 10) }}" loading="lazy" style="display: none;">
                {% endfor %}
            {% endif %}
        {% endif %}
        {% if socialFeed.message is not empty %}
            <div>
                {% if socialFeed.message|length > 120 %}
                    {% set message = socialFeed.message|slice(0, 120) ~ '...</p>' %}
                {% endif %}
                {{ (message ?? socialFeed.message)|raw }}
                <a href="{{ socialFeed.feedUrl }}" title="{{ readMore }}" target="_blank">
                    {{ readMore }}
                </a>
            </div>
        {% endif %}
    </div>
{% endfor %}

The craft.socialFeed.all() function accepts following parameters:

  1. (array) $conditions: An array of where-/andWhere-Conditions (see example above).
  2. (?int) $limit: Overwrite the default limit provided in the settings page.
  3. (?array) $orderBy: Order by one or multiple columns. The default is ['homm_socialfeeds.feedDateCreated' => SORT_DESC].

HOMM Social Feed Roadmap

Some things to do, and ideas for potential features:

  • Add filters in the CP section
  • Allow to save social feed images locally

Brought to you by HOMM interactive

统计信息

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

GitHub 信息

  • Stars: 3
  • Watchers: 1
  • Forks: 3
  • 开发语言: PHP

其他信息

  • 授权协议: proprietary
  • 更新时间: 2021-01-26

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固