These are chat archives for GetmeUK/ContentTools

9th
Jun 2016
Samuell
@Samuell1
Jun 09 2016 08:02
Hi, its there a tutorial for creating a new tool in toolbar with js? like more h3
Anthony Blackshaw
@anthonyjb
Jun 09 2016 08:41
Hi @Samuell1 - there's a tutorial on creating a new tool from scratch using CoffeeScript (http://getcontenttools.com/tutorials/adding-new-tools) but there's not one for JS at the moment. Having said that if you just want add an H3 tool here's a gist to do that in both CoffeeScript and JavaScript https://gist.github.com/anthonyjb/39b8d7242b7f520343bd7c4cebabcd82
Anton Komarev
@antonkomarev
Jun 09 2016 10:43
@anthonyjb Ah... Anthony I forgot to ask one more important thing. I've made 2 regions: title, body. Title is placed in <h1> and body is common <div>. But when I'm starting to type in Body region - first row in it all the time is <h1>. How to make regions starts from <p> row?
Anthony Blackshaw
@anthonyjb
Jun 09 2016 11:56
@a-komarev can you paste your HTML here for me to look at?
Anton Komarev
@antonkomarev
Jun 09 2016 12:03
@anthonyjb sure, right from sandbox... just remove all data from article region
<!DOCTYPE HTML>
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <title>ContentTools sandbox</title>
        <link rel="stylesheet" type="text/css" href="sandbox.css">
        <link rel="stylesheet" type="text/css" href="../build/content-tools.min.css">
    </head>
    <body>
        <article class="article">
            <section class="article__content"  >

                <h1 data-fixture data-name="article-title">

                </h1>

                <div data-editable data-name="article">

                </div>
            </section>
        </article>
        <script type="text/javascript" src="../build/content-tools.js"></script>
        <script type="text/javascript" src="sandbox.js"></script>
    </body>
</html>
Anthony Blackshaw
@anthonyjb
Jun 09 2016 13:27
that's a bug with my last release
so I accidentally left h1 as the default for the new region (when testing) it should be p
I'll push a fix in the next release, in the meantime either override the createPlaceholderElement method against the EditorApp or if you change the method in place (replacing h1 with p)