Giter Club home page Giter Club logo

oc-richeditorsnippets-plugin's Introduction

October Richeditor Snippets

Introduction

One of the great features of Rainlab Pages plugin is the Snippets feature. It allows the developer to hand over management of complex items, such as forms, maps, widgets, etc to the client. For more information on what a Snippet is, please see https://github.com/rainlab/pages-plugin#snippets.

This plugin simply extends the ability to re-use these snippets from any richeditor by providing an additional dropdown to the Froala Richeditor with a list of available snippets (supports partial and component based snippets). It also provides a twig filter to allow the parsing of implemented snippets.

For documentation regarding creating snippets, please see https://github.com/rainlab/pages-plugin#snippets-created-from-partials

Example usage for Rainlab Pages Syntax Fields

Option 1 (offset to variable)

{variable type="richeditor" tab="Content" name="text" label="Text"}{/variable}
{{ text | parseSnippets }}

Option 2 (wrap in filter)

{% filter parseSnippets %}
    {richeditor tab="Content" name="text" label="Text"}{/richeditor}
{% endfilter %}

Example usage for Rainlab Pages Content Blocks

{% filter parseSnippets %}
    {% content 'company-details.htm' %}
{% endfilter %}

Example usage in fields.yaml

If you do not set toolbarButtons you will not need to add snippets to the list. Please see example below when customization is required.

html_content:
    type: richeditor
    toolbarButtons: bold|italic|snippets
    size: huge

oc-richeditorsnippets-plugin's People

Contributors

alxy avatar gergo85 avatar matt-pawley avatar mattpawley avatar

Watchers

 avatar  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.