Jump to content

IPS 4.0: Editor - Part 3: Customisation and BBCode


IPS News
 Share

Recommended Posts

Introduction

 

Joining my previous entries about content and uploading features in post editor in IPS Social Suite 4.0, I'd like to take you through the customisation features on the editor.

 

 

Toolbar layout

 

The buttons that appear on the toolbar are completely customisable in 4.0 and you can set different layouts for desktop, tablet and mobile (so that you don't show more buttons than the device can show).

 

This is what the management screen looks like:

 

(This is an unfinished design - the tabs won't be be like that in the final version.)

 

To move a button you just drag and drop. The buttons on the right allow you to add more rows or separators.

 

 

Clicking on a button brings up a dialog where you can adjust where and to whom it shows:

 

 

 

Adding Buttons

 

There are two ways to add a button to the editor.

 

The easiest way is to install a CKEditor plugin. CKEditor has loads of plugins, and installing is as easy as uploading the zip file from their site. Here's a screenshot of the symbol plugin being used:

 

 

The second way is similar to how custom BBCode currently works, you specify the HTML code to be added when the user clicks on the button. Manually created buttons can optionally have a dialog popup to ask for an option.

 

 

Design

 

Just as you can install CKEditor plugins by uploading the zip file, you can do exactly the same with CKEditor skins to change the design of the editor.

You then simply set for each skin on your community which CKEditor skin to use for it.

 

 

BBCode

 

Though no features in IPS4 insert BBCode-style tags into the editor (like is currently done for attachments, etc.) users can still type BBCode into the editor and it will work fine.

 

We've rewritten how BBCode is parsed to be much more secure and reliable and produce more standards-compliant HTML (for those who are interested, it parses the post content into a DOM Document and examines only the text nodes for BBCode tags, then either splits the nodes surrounding it and inserts one for block-level elements, or wraps all subsequent text nodes in the appropriate formatting element until the end BBCode is found).

 

The benefit to this is that there now no longer needs to be a "BBCode mode" - you can type BBCode straight into the editor, even complicated stuff like lists spanning multiple lines, and it comes out looking great.

 

The downside to this approach is that custom BBCodes can no longer be added through the Admin CP. However, as mentioned above, we now have the ability to add custom buttons to the editor which work in a much more intuitive way, and can do everything that custom BBCodes could and more. For those who really want to be able to add the ability for custom BBCode, we've isolated the method that returns the supported BBCode (and information needed to parse them) into a specific method so that custom BBCode can be added with a very simple hook specific to that purpose.

 

 

Conclusion

 

There's still one more blog entry to go in our series on the editor. To finish up I'll be showing off some cool special features including how you can post using regular HTML.

Attached Thumbnails

  • Posted Image
  • Posted Image
  • Posted Image

  • View the full article

     

    View the full article

    Link to comment
    Share on other sites

     Share

    ×
    ×
    • Create New...

    Important Information

    By using this site, you agree to our Terms of Use.