定制 jbouzekri/sculpin-tag-cloud-bundle 二次开发

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

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

jbouzekri/sculpin-tag-cloud-bundle

Composer 安装命令:

composer require jbouzekri/sculpin-tag-cloud-bundle

包简介

Generate tag cloud in Sculpin

README 文档

README

SensioLabsInsight

This bundle generates a tag cloud in sculpin.

You can see a working demo on the right column of my personal french blog.

Installation

Using composer, add the dependancy to your composer.json :

require: {
    "jbouzekri/sculpin-tag-cloud-bundle": "1.*"
}

And run the composer update command

Enable the bundle. If you have already have an app/SculpinKernel.php, add this bundle to it otherwise create the file with the following content :

<?php

class SculpinKernel extends \Sculpin\Bundle\SculpinBundle\HttpKernel\AbstractKernel
{
    protected function getAdditionalSculpinBundles()
    {
        return array(
            'Jb\Bundle\TagCloudBundle\JbTagCloudBundle'
        );
    }
}

Then you need to add the tag cloud template and its stylesheets to your project

  • Copy the Resources/views/tag_cloud.html file in the _includes folder of your source
  • Copy the Resources/public/css/tag_cloud.css file in the css folder of your source (or you can directly add its content in your project stylesheets).

Usage

In a template, you can now call the following twig function :

{{ tag_cloud() }}

It will generate the html tag cloud.

You can specify a custom template :

{{ tag_cloud('my_template.html') }}

Configuration

jb_tag_cloud:
    tag_permalink: /tags/:taxon/index.html
    tag_entity: Jb\Bundle\TagCloudBundle\Model\Tag
    tag_cloud_entity: Jb\Bundle\TagCloudBundle\Model\TagCloud
    max_number: 0
    strategies:
        - jb_sculpin.tag_cloud.strategy.shuffle
        - jb_sculpin.tag_cloud.strategy.percent_size
  • jb_tag_cloud.tag_permalink : the pattern used for the url in the tag_cloud twig helper
  • jb_tag_cloud.tag_entity : the tag entity
  • jb_tag_cloud.tag_cloud_entity : the tag cloud entity
  • jb_tag_cloud.strategies : A list of services to manipulate the tag cloud. By default, shuffle randomize the order of the tags and percent_size calculate the tag weight based on its number of apparition.
  • jb_tag_cloud.max_number : used when enabling the strategy jb_sculpin.tag_cloud.strategy.max_number which will limit the number of tags to display in the cloud (if 0, all tags are displayed). This is global and will be applied to all tag clouds.
  • jb_tag_cloud.alpha: Used to display tags in alphabetical order. Can be combined with percent_size

License

MIT

This bundle was inspired by the tag-cloud library from lotsofcode

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2014-07-12

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固