Development

Bringing the Editor in line with your Template

Bringing the Editor in line with your Template

Introduction

From version 2.0 the ARK Editor comes with an ‘Auto Style-sheet Parser’ which does all the work of setting up the editors ‘editing area’ and 'Styles' drop down list. This means that you don’t need to know CSS, or spend hours styling up the editor’s editing area. However, there are still plenty of options for you to customise and filter out what styles you want the editor to use.

To do this please go to components > Ark Editor > Control Panel > Options > Styles, and you’ll see you now have 3 options with which to control how the Ark Editor works.

1.      Formatting & Display

This controls both the 'editing area and 'style lists' and is used for the operation of the Ark Editor.

You shouldn’t need to touch this however,  you can even tweak things if required.

With this you can define behaviours such as:

  • Add tweeking the styles to the Style and Format dropdown list.
  • Add background colour or img to the editor’s Style and Format dropdown list.
  • Tweek Alignment and thumbnail style for the modal box
  • And Media and audio Alignment
  • Also you can use the 'body.cke_editable' to limit styles element to the editing area

2.    Styles List

This option controls the editor’s drop down ‘Style List’.

This will allow you to choose one of three style sources or modes for how this list is populated:

  1. Auto Stylesheet parser (default)
    By default the Auto Stylesheet parser will do the work for the Style List. This is further enhanced by running your templates style through the ‘Exclude Stylesheets’ and ‘Exclude CSS selectors’ which works to filter out useless classes.
     
  2. Custom Styles
    The 2nd option is to use ‘Custom Styles’ which will open up the "Type (CSS)" options list below, comprised of Ark UIkit, Bootstrap 2 and 3, Bootstrap 3 (Gantry 5), and UIkit 2 and UIkit3 libraries. Please note: you must select the library that corresponds to your website template (please consult your website manager if necessary). Each library comprises a list of predefined 'Object', 'Block,' and 'Inline Styles. Advanced users have the option of adding their own styles by adding a class name to their template (i.e. p.myclass {}) which will add a new style to the editor style drop-down list

3. Custom Stylesheet File

        The 3rd option will allow you to add the file path to a stylesheet you have built yourself, by adding the path to your editor CSS (i.e. templates/[TEMPLATE NAME]/editor.css). The editor will then read for the         file and populate the editor’s drop down ‘Style List’. This is especially useful if you are switching from JCE.

3.      Auto Stylesheet Parser

The ‘Auto Style-sheet Parser’ is a ground breaking tool because it actually looks at what styles are being used in your template rather than just reading from a stylesheet directly.  Without it on you can end up with something that looks different because it is not reading the same styles that is being used on the frontend of your site. A classic example of this is with Joomla’s own Bootstrap. If an editor is to read from the bootstrap.css file directly then it will come with the stock Bootstrap styling however, most templates nowadays are using Bootstrap with its own  theme added to it. This can result in a button looking different in the editors editing area from how it is seen on the front end of your template. To overcome this and the complexity of modern templates we now need to look at what’s being rendered in the template first rather than pulling in a bunch of CSS stylesheets.

How to filter out stylesheets and CSS selectors?

The ‘Exclude Stylesheets’ and ‘Exclude CSS selectors’ filter out useless classes and is applied to all three of the 'Style List' source modes. Its setup to filter out useless stylesheets and classes which we don’t need in the editor's dropdown Style List. To do this:

Navigate to 'Components' > click on 'Ark Editor' and click on the 'Options' button. Under the 'Styles' tab > navigate to 'Auto Stylesheet Parser' > 'Exclude Stylesheets' and click on the 'Select' button.

This will bring up the lightbox seen below.

  2. Add the name of the Stylesheet you wish to exclude. For this example we have used the stylesheet named 'red'.

NOTE: Please note that you should not add '.css' or '.less', only add the 'name' of the style-sheet as seen below.

3. Lastly click on the 'Save' button and the main green 'Save' button to apply your changes.

NOTE: Please note that this may not work if your template is using the CSS @import method to import all stylesheets through one main template.css file.  If this is the case don’t worry you can still excludes CSS selectors from the options below.

How to exlcude a CSS styles:

Navigate to 'Components' > click on 'Ark Editor' and click on the 'Options' button. Under the 'Styles' tab > navigate to 'Auto Stylesheet Parser' > 'Exclude CSS Selectors' and click on the 'Select' button.

This will bring up the lightbox seen below.

  1. Add the name of the CSS style you wish to exclude.

How to include Stylesheets and CSS Selectors

To prevent the Style list coming prepopulated with loads of classes the editor comes with a blacklist of common styles.  This means it is plausible that a style you want to be listed in the editor ‘Style List’ isn’t there because it is using a popular naming convention. To include you can remove the filter by clicking on the ‘X’ next to the style name.

4.      Customising the Format list

This option allows you to define what font tags you would like in the editor’s ‘Format List’. To do this:

Navigate to 'Components' > click on 'Ark Editor' and click on the 'Plugin Manager' button and filter for format and open.  Under the 'Basic' tab > you will see a number of parameters which will allow you to add, modify the items which appear in the editor’s ‘Format’ drop down list.

So for instance if I want to add a new ‘code ‘element I would add this to the ‘Default text’ field and again in the ‘Element Name’. Lastly, click on the 'Add' button which will then include this in the format list.

Read more: Bringing the Editor in line with your Template

  • Hits: 56

Ark Editor - Configuration Options

Configuration Options

You can both access and edit these options by navigating to 'Extensions' > 'Ark Editor' and clicking on 'Ark Editor'. This will load up the screen as seen below:

Plugin Options

Administrator End Toolbar Mode List of available toolbars
FrontEnd Toolbar Mode List of available toolbars
Skin Office Metro
Use Template CSS Classes for Editing Area? Yes / No
Use Custom CSS Classes for Editing Area? Custom file path option
Use Template CSS Classes for Styles ComboBox? Yes / No
Use Custom CSS Classes for Styles ComboBox? Custom file path option
Location of the Images? Custom file path option
Location of the Documents? Custom file path option
Enter Mode P, BR or Div
Shift Enter Mode P, BR or Div
Width Width of editor
Height Height of editor

 

Advanced Options

Display Errors Yes / No
Language Selection Mode Manual / Joomla! Default / Browser Default
Language Code Set to 'en' by default
Background Color Hex color
Font Color Hex color
Font Size Set in pixels
Font Family Font family type
Text Alignment Default / Left / Center / Right / Justify / Inherit
Process HTML Entities Yes / No
Auto Format Source Yes / No
Enable Magicline Yes / No
Select the stylesheet you do not want the editor to use in WYSIWYG mode
Load Ark Editor typography Yes / No
Edit Ark Editor typography Edit the typo CSS style-sheet and Expand View
Dialog Background Overlay Color Set to 'black' by default
Dialog Background Overlay Opacity Set to '0.5' by default

Read more: Ark Editor - Configuration Options

  • Hits: 35

Ark Editor - Global User Permissions

Global User Permissions

As well as being able to set user permissions on a plugin by plugin level it also allows for the global permissions to be set. This will allow one user group to edit and another groups permissions can be set to deny edit access. 

To do this please go to 'Components' > ‘ARK Editor’ > click on the 'Options' button on the top righthand side of the screen and select the 'Permissions' tab.

Read more: Ark Editor - Global User Permissions

  • Hits: 17

Ark Editor - User Folders

User Folders

If you are using the pro verison, user folders will be enabled by default.  This allows your users to manage their own images and files and restrict who can view them.

To do this please go to 'Components' > ‘ARK Editor’ > click on the 'Options' button on the top righthand side of the screen and select the 'Media Manager' tab.

Setting: Enable User Folders:
Description:
This option enables user folders for those using the media manager.
User Folder Type:
This determines if we should use the users username or userid for their root folder.
Enable Users to see all Folders:
Users selected here will be able to see all folders for images or documents. Note by default Super Users are given this right.
Root Image Path:
Location for the Media Manager to look for images.
Root Document Path:
Location for the Media Manager to look for documents.

Please see below for an example of the user folder structure on the server.

The file path for these files (by default) is:

Please note that once you have chosen your configuration, the users, username / id will be embedded in the image file path.

E.g, image file path:

img src="/ images/users/username/mypic.jpg " alt="

User Folders Permissions

Next the editor will allow you to assign rights to specific Joomla user groups. This parameter will allow the selected user groups permission to view “all user folders”. Generally speaking only the ‘Super Users’ should be permitted to view all files however, if you would like to apply this to multiple user groups, you can do this by 'clicking' and holding down the ‘Shift’ key.

Read more: Ark Editor - User Folders

  • Hits: 54