定制 doublesecretagency/craft-upvote 二次开发

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

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

doublesecretagency/craft-upvote

最新稳定版本:3.1.0

Composer 安装命令:

composer require doublesecretagency/craft-upvote

包简介

Lets your users upvote/downvote, "like", or favorite any type of element.

README 文档

README

Plugin icon

Upvote plugin for Craft CMS

Lets your users upvote/downvote, "like", or favorite any type of element.

Upvote & Downvote (similar to Stack Exchange)

Just specify the element ID of the item you want users to vote on. Any element type (Entry, Asset, User, etc) will work!

<table>
    {% for entry in craft.entries.section('superHeroes') %}
        <tr>
            <td>
                <div>{{ craft.upvote.upvote(entry.id) }}</div>
                <div>{{ craft.upvote.tally(entry.id) }}</div>
                <div>{{ craft.upvote.downvote(entry.id) }}</div>
            </td>
            <td>{{ entry.title }}</td>
        </tr>
    {% endfor %}
</table>

"Like" (similar to Facebook)

Very similar to the configuration described above, except with:

  • Downvoting disabled
  • Customized "up" icon

"Favorite" (similar to a bookmarking system)

You can easily see what votes have been cast by a particular user...

craft.upvote.userHistory()

Read more about using the user voting history.

Customize Icons

It's easy to customize your icons. You can either adjust the CSS, or replace the icons entirely.

{% do craft.upvote.setIcons({
    up   : '<i class="fa fa-thumbs-up"></i>',
    down : '<i class="fa fa-thumbs-down"></i>',
}) %}

By default, Upvote uses the Font Awesome library. Which means you can easily swap to a different icon from the Font Awesome collection. And if you'd rather not use Font Awesome, you can disable the library from being included at all.

Sort by Highest Voted

Once your users have cast votes, you'll want to know which items are the most popular...

{% set heroes = craft.entries.section('superHeroes') %}
{% do craft.upvote.sort(heroes) %}

This will grab the list of elements normally, then sort them by highest voted.

Settings

Here's a screenshot of the plugin's settings page...

To see some other ways that Upvote is flexible, check out the full documentation...

Further Reading

If you haven't already, flip through the complete plugin documentation.

And if you have any remaining questions, feel free to reach out to us (via Discord is preferred).

On behalf of Double Secret Agency, thanks for checking out our plugin! 🍺

Logo for Double Secret Agency

统计信息

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

GitHub 信息

  • Stars: 16
  • Watchers: 1
  • Forks: 6
  • 开发语言: PHP

其他信息

  • 授权协议: proprietary
  • 更新时间: 2018-05-08

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固