All Projects → dukt → like

dukt / like

Licence: other
Let your users like your Craft website's entries, assets and any other element.

Programming Languages

PHP
23972 projects - #3 most used programming language
HTML
75241 projects

Projects that are alternatives of or similar to like

craft.doxter
Markdown editor and parser for Craft CMS
Stars: ✭ 80 (+81.82%)
Mutual labels:  craftcms, craft-plugin, craft2
craft-router
A Craft CMS plugin for using URL segments as filtering criteria on an entry query.
Stars: ✭ 21 (-52.27%)
Mutual labels:  craftcms, craft-plugin, craft2
store-hours
Manage business hours with Craft CMS.
Stars: ✭ 60 (+36.36%)
Mutual labels:  craftcms, craft-plugin, craft2
PowerNap
Sample Task plugin
Stars: ✭ 15 (-65.91%)
Mutual labels:  craftcms, craft-plugin, craft2
query
Run SQL queries as an admin from the Craft CMS control panel.
Stars: ✭ 14 (-68.18%)
Mutual labels:  craftcms, craft-plugin, craft2
anchors
Add anchor links to headings in your Craft CMS website content.
Stars: ✭ 47 (+6.82%)
Mutual labels:  craftcms, craft-plugin, craft2
AssetSubfolderAccess
Limits user groups to only access certain asset subfolders
Stars: ✭ 18 (-59.09%)
Mutual labels:  craftcms, craft-plugin, craft2
craft.patrol
Patrol simplifies SSL and maintenance routing for sites built with Craft
Stars: ✭ 90 (+104.55%)
Mutual labels:  craftcms, craft-plugin, craft2
DigitalProducts
Sell digital products with Craft Commerce
Stars: ✭ 48 (+9.09%)
Mutual labels:  craftcms, craft-plugin, craft2
Similar-Craft
Find similar elements
Stars: ✭ 32 (-27.27%)
Mutual labels:  craftcms, craft2
commerce-stripe
Stripe payment gateway for Craft Commerce
Stars: ✭ 21 (-52.27%)
Mutual labels:  craftcms, craft-plugin
craft-react
Client and Server-side React rendering for CraftCMS
Stars: ✭ 40 (-9.09%)
Mutual labels:  craftcms, craft-plugin
Inlin-Craft
Plugin for inlining files in templates.
Stars: ✭ 64 (+45.45%)
Mutual labels:  craftcms, craft2
craft-donkeytail
A Craft CMS fieldtype for content managing points on images.
Stars: ✭ 53 (+20.45%)
Mutual labels:  craftcms, craft-plugin
craft-assetmetadata
Asset Metadata plugin for Craft CMS
Stars: ✭ 31 (-29.55%)
Mutual labels:  craftcms, craft-plugin
craft-typogrify
Typogrify prettifies your web typography by preventing ugly quotes and 'widows' and more
Stars: ✭ 70 (+59.09%)
Mutual labels:  craftcms, craft-plugin
Form-Builder
Craft CMS plugin that lets you create and manage forms for your front-end.
Stars: ✭ 16 (-63.64%)
Mutual labels:  craftcms, craft2
Craft-User-Manual
📚 Help Section Plugin for Craft CMS.
Stars: ✭ 86 (+95.45%)
Mutual labels:  craftcms, craft-plugin
craft-cookies
A simple plugin for setting and getting cookies from within Craft CMS templates.
Stars: ✭ 36 (-18.18%)
Mutual labels:  craftcms, craft-plugin
pathtools
DEPRECATED This twig plugin for the Craft CMS brings convenient path & url manipulation functions & filters to your Twig templates.
Stars: ✭ 19 (-56.82%)
Mutual labels:  craftcms, craft-plugin

Like for Craft CMS

A simple plugin to connect to Like's API.


Installation

  1. Download the latest release of the plugin
  2. Drop the like plugin folder to craft/plugins
  3. Install Like from the control panel in Settings > Plugins

Templating

Like button

{% if currentUser %}
    {% if craft.like.isLike(element.id) %}
        <a class="btn btn-default" href="{{actionUrl('like/remove', {id:element.id})}}"><span class="glyphicon glyphicon-star"></span> Unlike</a>
    {% else %}
        <a class="btn btn-primary" href="{{actionUrl('like/add', {id:element.id})}}"><span class="glyphicon glyphicon-star"></span> Like</a>
    {% endif %}
{% else %}
    <a class="btn disabled btn-primary" >Like</a>
{% endif %}

List likes for an element

{% set likes = craft.like.getLikes(element.id) %}

{% if likes|length > 0 %}

    {% for like in likes %}
        <a >
            {% if like.user.photoUrl %}
                <img src="{{like.user.photoUrl}}" width="34" class="img-rounded" data-toggle="tooltip" data-original-title="{{like.user.email}}" />
            {% else %}
                <img src="http://placehold.it/34x34" data-toggle="tooltip" class="img-rounded" data-original-title="{{like.user.email}}">
            {% endif %}
        </a>
    {% endfor %}

{% endif %}

Your Likes

Entries and asset that you like.

Entries:

{% set entries = craft.like.getUserLikes('Entry') %}

{% if entries %}
    <ul>
        {% for entry in entries %}
            <li>{{entry.title}}</li>
        {% endfor %}
    </ul>
{% else %}
    <p>You haven't liked any entry yet.</p>
{% endif %}

Assets:

{% set assets = craft.like.getUserLikes('Asset') %}

{% if assets %}
    <div class="row">
        {% for asset in assets %}
            <div class="col-md-4">
                <img class="thumbnail img-responsive" src="{{asset.url({width:200, height: 140})}}" />
            </div>
        {% endfor %}
    </div>
{% else %}
    <p>You haven't liked any asset yet.</p>
{% endif %}

API

LikeVariable

  • isLike($elementId)
  • getLikes($elementId = null)
  • getUserLikes($elementType = null, $userId = null)
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].