1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.
  2. This forum has been archived. New threads and replies may not be made. All add-ons/resources that are active should be migrated to the Resource Manager. See this thread for more information.

Cel Editor Button Management

Discussion in 'Add-on Releases [Archive]' started by cellarius, Sep 17, 2011.

  1. cellarius

    cellarius Active Member

    Exploring xenForo to find out whether I could do what I need with it, one of the first things I tried to find out was whether I could add additional buttons to the editor. Taking some inspiration from ragtek and this thread, I found the buttons to be hardcoded and found no way different addon coders could add buttons each. If there is, I'll don a tinfoil hat and blame my inexperience with xF so far :D

    What does it do?

    This simple (but quite powerfull) button manager gets around this problem by taking the button configuration for the two xF editor toolbars into two templates. This solution offers the following advantages:
    • existing buttons can easily be added, removed, or moved about (yes, I am aware that removing buttons will not prevent people from simply typing bbcode; it can still be useful if you trigger non-bbcode actions by button)
    • custom buttons can easily be added; addon developers could simply point to this addon
    • the full flexibility of xenForos template conditionals can be used on each single buttons or button groups, making it easy to show buttons to certain usergroups only for example (see Shadabs how-to)
    Minor disadvantage:

    • Since the templates overwrite the xF button configuration, new buttons will have to be added manually to the templates
    How does it work?

    The configuration templates are CelEditorButtons1 and CelEditorButtons2. The buttons are listed comma seperated and each in a new line in the templates for better overview. See the attached screenshots for an example.
    xFbuttons.JPG xFbuttons_result.JPG
    Explanation: Bold and italic buttons have changed position, strikethrough has been removed, and a custom button ("celphotopopup") has been added. The alignment buttons have been wrapped by a condition, as has the image bbcode. They are hidden for the current users usergroup.


    Upload the library directory into your xF root directory. Install the included .xml file as an addon. Done.

    Attached Files:

    kisianhsang, DRE, Fuhrmann and 13 others like this.
  2. cellarius

    cellarius Active Member

    For Reference:

    The buttons currently present in xF in toolbars 1 and 2 are:
    Abracadaniel and Veer like this.
  3. Digital Doctor

    Digital Doctor Well-Known Member

    This is great stuff !!!
    How hard would it be to add Text:Red (as just the single choice) ? xenforo.cel.editor.button.management.jpg

    I think this will be extra helpful for the BBCoders.
    a legacy reborn likes this.
  4. Digital Doctor

    Digital Doctor Well-Known Member

    Idea: paid members get better toolbar options !
    a legacy reborn likes this.
  5. cellarius

    cellarius Active Member

    You would have to create a plugin to the editor that does that (as described by ragtek), create a button, then use this mod to add the button to the editor.
    Digital Doctor likes this.
  6. ragtek

    ragtek Guest

    It would be a**kicking add-on if the button names would be replaced with the button icons which could be placed via drag & drop:D
    HydraulicJack likes this.
  7. Tealk

    Tealk Active Member

    If i use the File in your Post i become this message
    "Bitte gib eine gültige Callback-Methode ein."
  8. cellarius

    cellarius Active Member

    Do you have uploaded the library directory in the .zip-file into your xF-root directory? It will add the folder CelEditorButtons to your library folder, containing Listener.php.
  9. cellarius

    cellarius Active Member

    Anyway, it would be really easy for Kier and Mike to add the editor configuration that is now in the js file to templates (or one template), just like this addon does. I'd sure like to see this become obsolete (hint, hint). Hm, should probably make a suggestion out of this.
  10. Tealk

    Tealk Active Member

    yes i have
  11. Romchik®

    Romchik® Well-Known Member

    Folder in ZIP has name Cel EditorButtons (not CelEditorButtons).
    cellarius likes this.
  12. Tealk

    Tealk Active Member

    oh ok thx
  13. cellarius

    cellarius Active Member

    Oh, damn, how did that happen... sorry to everyone who had problems because of me being stupid ;)

    Package updated.
  14. vkams

    vkams Active Member

    After installing this addon I tried to add spoiler button (in vain), but than my QuickReply visual editor could not load toolbars and it displays only raw text. I've uninstalled the mod, but quick reply is still broken. How to repair it??!
  15. Digital Doctor

    Digital Doctor Well-Known Member

    refresh the browser ?
  16. vkams

    vkams Active Member

    Of cause I refreshed it and even re-logined and turned off all other modes. No changes! :cry:
  17. vkams

    vkams Active Member

    Maybe server cache did not updated yet. Waiting...
  18. vkams

    vkams Active Member

    Oh, all return to normal work.

    I do ask developers to improve editor and give us simple way for addition custom buttons for bb-codes (images and actions)!
  19. Trekkan

    Trekkan Well-Known Member

    Installed this on 1.1 B5, but all toolbars are gone from the editor, just an empty text box displays. Still looking to see what might be wrong, but so far, nada.
  20. Brendon Meynell

    Brendon Meynell Active Member

    Any update on this Trekkan as I was about to install it but am using 1.1b5 and saw your post so have come to a screaming halt on the install.

Share This Page