Forum

Thread tagged as: Problem, Installation, Addons

Custom editor not working

Hi, i want to install a custom editor (CKEditor with custom fields), I follow all the instructions in your doc https://docs.grabaperch.com/docs/customizing-perch/installing-editors/ and it do not work. MarkItUp it does.

Any idea? Need to update perch maybe? Running on 2.4.4

Thanks

Raul Serrano

Raul Serrano 0 points

  • 6 years ago
Rachel Andrew

Rachel Andrew 394 points
Perch Support

Yes, before requesting support you need to be sure you are running the latest version of Perch.

Update Perch, if you still have a problem then post back including your Diagnostics Report.

Simon Clay

Simon Clay 127 points

Hi,

What do you see in the edit page?

Can you show an example of your template.

Hi, I update it to last version of perch, but nothing. MarkItUp goes fine.

The edit form: - adds the 'ckeditor2' class to the textarea in the edit form. - do not print my _config.inc file on head.

<head> from the edit form:

<head>
    <meta charset="utf-8" />
    <title>Manage Content</title>
    <meta name="viewport" content="width=device-width" />   <!--[if lt IE 9]><link rel="stylesheet" href="/perch/core/assets/css/iebase.css?v=2.7.6" type="text/css" /><![endif]-->

    <link rel="stylesheet" href="/perch/core/assets/css/v2.css?v=2.7.6" type="text/css" />
    <link rel="stylesheet" href="/perch/core/assets/css/assets.css?v=2.7.6" type="text/css" />
    <link rel="stylesheet" href="/perch/core/assets/css/720.css?v=2.7.6" type="text/css" media="only screen and (min-width: 720px)" />

    <!--[if lt IE 9]><link rel="stylesheet" href="/perch/core/assets/css/720.css?v=2.7.6" type="text/css" /><![endif]-->
    <!--[if IE 7]><link rel="stylesheet" href="/perch/core/assets/css/ie7.css?v=2.7.6" type="text/css" /><![endif]-->
    <!--[if IE 6]><link rel="stylesheet" href="/perch/core/assets/css/ie6.css?v=2.7.6" type="text/css" /><![endif]-->   
    <style type="text/css">.topbar{background-color: #ffffff; }</style>
    <link rel="stylesheet" href="/perch/core/assets/css/repeaters.css?v=2.7.6" type="text/css" />
    <script src="/perch/core/assets/js/head.min.js?v=2.7.6"></script>
</head>

My template:

<perch:content type="textarea" label="Texto" id="textoTeam" html="true" editor="ckeditor2" />

My _config.inc file:

<script type="text/javascript" src="PERCH_LOGINPATH/addons/plugins/editors/ckeditor2/adapters/jquery.js"></script>
<script type="text/javascript" src="PERCH_LOGINPATH/addons/plugins/editors/ckeditor2/build-config.js"></script>
<script type="text/javascript" src="PERCH_LOGINPATH/addons/plugins/editors/ckeditor2/ckeditor.js"></script>
<script type="text/javascript" src="PERCH_LOGINPATH/addons/plugins/editors/ckeditor2/config.js"></script>
<script type="text/javascript" src="PERCH_LOGINPATH/addons/plugins/editors/ckeditor2/styles.js"></script>
<script type="text/javascript" src="PERCH_LOGINPATH/addons/plugins/editors/ckeditor2/lang/es.js"></script>

<link rel="stylesheet" href="PERCH_LOGINPATH/addons/plugins/editors/ckeditor2/contents.css" type="text/css" />
Drew McLellan

Drew McLellan 2638 points
Perch Support

Do you get any errors in the browser console?

No errors in the browser console.

My complete template:

<perch:repeater id="imagesWho" label="Imagenes del who">
    <perch:before><ul class="rslidesWho"></perch:before>
    <li>
        <img src="<perch:content type="image" id="imageTeam" label="Imagen del equipo" width="650" height="400px" crop="true" />" alt="Equipo oficina 4play" />
    </li>
    <perch:after></ul></perch:after>
</perch:repeater>
<perch:content type="textarea" label="Texto" id="textoTeam" html="true" editor="ckeditor2" />

The sample CKEditor page works fine inside Perch's folder https://oficina4play:8888/perch/addons/plugins/editors/ckeditor2/samples/

It's like _config.inc is not loading files

Drew McLellan

Drew McLellan 2638 points
Perch Support

Can you see you code included at the end of the page?

Yes, source its complete

Drew McLellan

Drew McLellan 2638 points
Perch Support

So your code is there?

Yes, no errors, full code.

Drew McLellan

Drew McLellan 2638 points
Perch Support

Sounds like there's something wrong with your code then.

How do I know if this point is working?

Include the special file perch/addons/plugins/editors/myeditor/_config.inc in the <head> section of the edit page.

I do not see any extra callings in my head

Drew McLellan

Drew McLellan 2638 points
Perch Support

You told me you saw them at the bottom of the page.

I saw my code. Not the editors calling.

Drew McLellan

Drew McLellan 2638 points
Perch Support

What do you mean the "editors calling"?

Excuse me Drew, _config.inc loads in the bottom, correct, I was expecting to appear in the <head> section of the edit page.

Then there is a 'ckeditor2' class in the textarea, and _config.inc in the bottom of the page.

Whats going on then...

Thanks for your time Drew

Drew McLellan

Drew McLellan 2638 points
Perch Support

Have you added code to apply the editor to a textarea with that class?

just added editor="ckeditor2" in the template.

Drew McLellan

Drew McLellan 2638 points
Perch Support

That's not enough. You need to apply the editor to any textarea with that class.

But I thought that class is added by perch to any textarea with editor=ckeditor2, isn't it?

According to the instructions:

When you specify editor="myeditor" on a template tag, Perch will do two things Add a class of myeditor to the textarea field in the edit form Include the special file perch/addons/plugins/editors/myeditor/_config.inc in the <head> section of the edit page. The _config.inc file should include any HTML output needed to initialise your editor. Usually that will be links to its JavaScript and CSS files.*

I don't understand, could you please explain me a bit?

Drew McLellan

Drew McLellan 2638 points
Perch Support

The class it added by Perch. The class does nothing on its own.

You need to apply your editor to any textarea with that class. If you can't do that, you might be better to hire a developer to work with. This is beyond what we can help you with in support.