Jump to content

Control editor width in your mods.

Guest Michael

Recommended Posts

I used this topic to add the IPB 2.1 editors to a mod I was working on and it worked great, but I have one suggestion that I think should be added to enhance this editor handler. The width of this editor should ideally be able to be configured for the mod, in case the mod structures the page a bit differently.

For example, the mod I'm working on has the left third of the page taken up with a navigation bar. When I use the standard 650px editor in the remaining board space, my page is cramped on my 1024x768 laptop. When I set it to 100% in the Topics, Posts, & Polls section, it looks great in my mod, but then when I go to my board it is way too wide. So I suggest being able to add an incoming data variable to the init function to be able to set the width.

In han_editor.php, make the following changes. Find:

	function init()

Change to:

	function init($width="")


		$this->ed_width = $this->ipsclass->vars['rte_width'] ? $this->ipsclass->vars['rte_width'] : $this->ed_width;

Add Below:

		$this->ed_width = $width ? $width : $this->ed_width;

Now, whenever you go to use the instructions from the topic linked above, instead of using this line in your mod:


You can use this:


You can set either a percent or pixel value and it will be used only for your mod. And you also don't have to set any value if you don't want, and it will just use the value as specified in the ACP. I think these couple of minor changes would be a big benefit to those of us that would use the editors handler. ;)

Link to comment
Share on other sites


This topic is now archived and is closed to further replies.

  • Recently Browsing   0 members

    • No registered users viewing this page.
  • Create New...