GithubHelp home page GithubHelp logo

page_builder's Introduction

Page Builder

plugin for create pages structure using wysiwyg (TinyMCE). Examples

install

npm install @koterion/page_builder

use

Include TinyMCE

<script src="https://cloud.tinymce.com/5/tinymce.min.js?apiKey=your_API_key"></script>

Include Material Icons

<link href="https://fonts.googleapis.com/icon?family=Material+Icons+Outlined" rel="stylesheet">

css

@import url('~@koterion/page_builder/dist/css/pageBuilder.css');

or (if use Postcss import)

@import url('@koterion/page_builder');

js

import '@koterion/page_builder'

pageBuilder.create(selector, options)

html

<div class="YourUniqueClass" data-yourData="dataInfo">HTML</div>

or

<textarea class="YourUniqueClass" name="YourUniqueName" data-yourData="dataInfo">HTML</textarea>

Options

option type desc
tinymceSettings object TinyMCE settings
height string Workplace height
rowClasses string Row class names. Can use from html data.
colClasses string Col class names. Can use from html data.
edit boolean Turn on/off editing blocks. Can use from html data.
draggable boolean Turn on/off dragged cols & row

You can use option in dataset like:

<div data-height="500px">HTML</div>

##Methods

method desc
pageBuilder.create(selector, options) Create workplace
pageBuilder.getContent(id) Get content of current by id field
pageBuilder.rebuild(id) Rebuild current by id field

Examples:

use:

import '@koterion/page_builder'

pageBuilder.create(document.querySelector('.textarea'))

tinymce

Initialize TinyMCE. Use className for selector

{
  tinymceSettings: (className) => {
    tinymce.init({selector: className})
  }
}

rowClasses

Use in current format, separator ', '

{
  rowClasses: 'first, second, third'
}

or

<div data-rowClasses="first, second, third">HTML</div>

colClasses

Use in current format, separator ', '

{
  colClasses: 'full, text'
}

or

<div data-colClasses="full, text">HTML</div>

page_builder's People

Contributors

koterion avatar

Watchers

James Cloos 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.