How easy would it be to add something like this via a module or widget?

One of the things that I would like to keep the same across all my blog posts, is the fact that in blogCFC we used to be able to type


And the our code in here

Now there are a couple of things that I would like to do, one would be to some how by using a widget or module, be able to add this feature to the editor where I could use the paste special or paste code to do this. And if at all possible to allow others the same feature, but make it configurable to how they would like to have their code pasted. For example I would prefer the syntax presented above, but also wrapped in

 tags as well.

Now converting over from blogCFC does work, but if you try to follow the same conventions that you are used to over there to keep imported and newer posts the same. This sort of thing would be a great. Now I can certainly type the above code in, but I have a style sheet that styles the pre tag in a post. Which means that unless I then manually type in the

 wrapper for each content of code then the look and feel will not match the already imported content.

I have played around with many aspects of using the blocCFC importer to not have to have it wrapped in the

, but was not very succesful in getting it to remain the same without these tags wrapped around the code.

Now I am sure I can modify the code to incoprate this, but wanted to get other peopls opinions on code pasting into the editor and if a setting for how the code is wrapped. Now this begs the question could something like this be core, I think it could, but I also think that it could be an adable module as well. The only problem would be how to get the module / widget to hook itself into the editor so it could be used, if it wouldn’t be considered to be core.

Andrew are you saying to add a feature that parses the [code] at the front ENd into

Or are you saying adding a button to the editor to write that for you?

Yes Luis, I am saying that a button adds

[code][/code]

The parsing of that then should be left up to any module / widget that then wants to make it pretty.

Now I have used the above as an example, because the one major problem with importing code from blogCFC was that the code had to be wrapped in

 so I think if we work with that, then we have a basis of a standard that anyone who wishes to them write a module / widget to make it pretty has something to work with.

Also for this to work, the interceptor announce will have to moved into the templates for entries and pass in the data to the interception point for all themes. At the moment this is not happening, which means making changes like this on these events can’t happen.

Ok can you look at the creditor integration code and see where we could put some interceptions so it can be customized? As for the actual content translation we already have an interception point for it already.

Luis Majano
CEO
Ortus Solutions, Corp
www.ortussolutions.com

ColdBox Platform: http://www.coldbox.org
Linked In: http://www.linkedin.com/pub/3/731/483
Social: twitter.com/ortussolutions | twitter.com/coldbox | twitter.com/lmajano