Coder Social home page Coder Social logo

gelliravi / mezzanine-blocks Goto Github PK

View Code? Open in Web Editor NEW

This project forked from renyi/mezzanine-blocks

0.0 2.0 0.0 253 KB

A mezzanine flavored fork of django-flatblocks. The goal of this project is to be able to easily create custom blocks of HTML in the template, and can be editable via admin.

License: BSD 2-Clause "Simplified" License

mezzanine-blocks's Introduction

Overview

A mezzanine flavored fork of [django-flatblocks] 1. The goal of this project is to be able to easily create custom blocks of text/HTML in the template, and can be editable via admin.

Features

  1. Raw Text Block, Rich Text Block, Image Block
  2. Multisite support (via Mezzanine's Slugged).
  3. Frontend inline editing.
  4. Categories for easier block management.
  5. Optional MPTT support for categories.

Requirements

Required - [Mezzanine CMS] 2

Optional - [Django MPTT] 3

Installation

  1. Add mezzanine_blocks to your virtualenv or clone the repository :
    pip install git+git://github.com/renyi/mezzanine-blocks.git
  1. Add "mezzanine_blocks" to INSTALLED_APPS:
    INSTALLED_APPS = (
        "...",
        "mezzanine_blocks",
    )
  1. Add blocks menu item to admin menu (Optional):
    ADMIN_MENU_ORDER = (
        ("Content", (
                "pages.Page",
                "mezzanine_blocks.Block",
                "mezzanine_blocks.RichBlock",
                "mezzanine_blocks.ImageBlock",
                "blog.BlogPost",
                "blog.BlogCategory",
                "generic.ThreadedComment",
                ("Media Library", "fb_browse"),
            )
        ),
    )
  1. Run python manage.py createdb or python manage.py syncdb && python manage.py migrate.

Usage

  1. Include block_tags in the template:

    {% load ... block_tags %}

  2. Insert block anywhere in the template:

    {% flatblock "My Awesome Block" %}

    {% richflatblock "My Awesome HTML Block" %}

    {% imageflatblock "My Image Block" %}

  3. You should see the blocks in the admin.

Options

Options are similar to django-flatblocks.

{% flatblock {block} %}
{% flatblock {block} {timeout} %}
{% flatblock {block} using {tpl_name} %}
{% flatblock {block} {timeout} using {tpl_name} %}

{% richflatblock {block} %}
{% richflatblock {block} {timeout} %}
{% richflatblock {block} using {tpl_name} %}
{% richflatblock {block} {timeout} using {tpl_name} %}

{% imageflatblock {block} %}
{% imageflatblock {block} {timeout} %}
{% imageflatblock {block} using {tpl_name} %}
{% imageflatblock {block} {timeout} using {tpl_name} %}

Installation

Version 0.9

- Bumped version to 0.9.
- Added Image Block.
- Added Categories for easier block management (Optional MPTT).
- Added frontend inline editing tags to templates.
- Bugfix: Problem with slug when block title has whitespace.
- Cache key prefix now editable in defaults.py.

Version 0.1

- Initial Release
- RawText block, and RichText block.
- Multisite support.

mezzanine-blocks's People

Contributors

renyi avatar shiraleeana avatar adrian-the-git avatar orutherfurd avatar

Watchers

 avatar James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.