Syntax Highlighting for CMSimple's back-end ?

Discussions and requests related to new CMSimple features, plugins, templates etc. and how to develop.
Please don't ask for support at this forums!

Re: Syntax Highlighting for CMSimple's back-end ?

Postby Tata » Mon Jul 18, 2011 7:19 pm

Hi, guys!
I am thinking about this new effort - Syntax Highlighting in back-end. And I am not sure if this is worth to spend time on it. It may be possible to make it. But my point of view is:
1. Who needs to work in source code? Only those understanding the code. Simple endusers mostly relies on ready made templates, plugins, addons etc. They do not need to work with code.
2. Do those skilled to work with code work online? Wery seldom. They mostly work locally, test locally and only upload ready files. If they whysoever need to change something in the code online, they are skilled enough to work even without higlighted syntax.
3. Those making templates and stylesheets use advanced editors with all pro functions.
4. Working with such editors allows the use of structured code. The content area is seldom width enough to allow this. (solution would be, if the source-code-mode would be always expanded to fullscreen to keep the structure easy readable)
5. Who of you CMSimple-gurus need this feature really? Wouldn't it be smarter "to teach beggar to fish than giving him a fish in hand?" I mean get users understand the basics (syntax, rules etc.) and get them studying locally before entering muddy waters of internet?

I am really not sure. Iwas building pure HTML webpages long time in HomeSite or Dreamweaver (even short time also while learning about CMSimple). But very soon I stopped using these two tools and remained on basis of Notepad++, TopStyle and WAMP. If whatever is to be changed on the "sharp website" I always have its copy and make changes first locally. Only if everything works as demanded, goes everything changed again up to host. I am sure you do it the same way. Changes made online may be VERY dangerous and may make this forum full of requests "What did I wrong?"

But - as always - I maybe missed some point and the idea having syntax-highlighted textarea is something CMSimple-revolutionary.
Image
It's no shame to ask for an answer if all efforts failed.
But it's awful to ask without any effort to find the answer yourself.
Tata
 
Posts: 1438
Joined: Tue May 20, 2008 5:34 am
Location: Slovakia

Re: Syntax Highlighting for CMSimple's back-end ?

Postby bca » Mon Jul 18, 2011 9:25 pm

I think it is a useful addition which may not be useful to everyone but a great help when developing a site and tweaking the code to get exactly what you/your client wants.
I do most of my initial development outside of CMSimple but sometimes just wanted to add a slight change and have got frustrated with the lack of formatting when editing in the backend. Obviously once the site is completed Codeeditor would not be needed as I dont expect the client would do any tweaking - in fact sometimes I CHMOD the stylesheet and template unwriteable. (Maybe we need a Developer mode?)

So I will use CodeeditorXH - well done Christoph.
(It could do with line wrap though ;) )

Anything else up your sleeve?

B
bca
 
Posts: 200
Joined: Tue Sep 15, 2009 4:49 pm

Re: Syntax Highlighting for CMSimple's back-end ?

Postby Gert » Mon Jul 18, 2011 10:09 pm

After some trys I have found out:

CodeMirror can't worrk with automatic linebreaks. If you allow automatic linebreaks - the coursor can't be set correctly.

So you mostly will have a horizontal scrollbar, some templates will be destroyed by using CodeMirror. However - looks nice, but it's not really good usable, especially in small content areas. So I gree with Tata.
Gert Ebersbach | CMSimple | Templates - Plugins - Services
Gert
 
Posts: 4546
Joined: Fri May 30, 2008 4:53 pm
Location: Berlin

Re: Syntax Highlighting for CMSimple's back-end ?

Postby cmb » Mon Jul 18, 2011 11:54 pm

Hello developers,

thanks for your feedback!

As I've already wrote in the starting post of this thread: I really don't know, if syntax highlighting (and some additional typical code editing features) are really useful for CMSimple's backend. But as I found out, it could be done as a simple plugin. So every single user could decide, if he wants this addition or if he rather lives without it. The current time for developing the current solution was about 2-3 hours!! So I don't think, it was really a waste of time.

I personally prefer to make adjustments to the template or the stylesheets in my accustomed editor locally on my xampp or via ftp on the webserver. But I can imagine situations, when I want to make slight adjustments to those files, not working on my machine, but perhaps from a customers PC ("oh, BTW, is it possible to have a border around that?"), where neither FTP client nor FTP capable editor are available. So an already installed CodeEditor_XH might help a little bit.

I'm aware of CodeMirrors constraints (particularly no line wrap available). And I don't want to spend too much time in developing CodeEditor further. Indeed there isn't too much that can be done to improve it.

Tata wrote:Changes made online may be VERY dangerous and may make this forum full of requests "What did I wrong?"

I guess you're right! But the current situation allows user to make those changes online right now. I doubt, that CodeEditor will make that worse. The typical end-user won't use it.

Tata wrote:I maybe missed some point and the idea having syntax-highlighted textarea is something CMSimple-revolutionary.

It is definitly not revolutionary! Just a tiny addition to CMSimple's toolbox.

bca wrote:in fact sometimes I CHMOD the stylesheet and template unwriteable. (Maybe we need a Developer mode?)

This might be a very good idea. It might be discussed in another seperate thread in Open Development. IMO there are some more things, which would better be hidden from end-users.

bca wrote:So I will use CodeeditorXH - well done Christoph.

Thank you. :D

bca wrote:It could do with line wrap though

CodeMirror user manual wrote:Note: CodeMirror 2 does not support line-wrapping. I would have very much liked to support it, but it combines extremely poorly with the way the editor is implemented.

:(

bca wrote:Anything else up your sleeve?

Currently I'm wearing a T-shirt, so there can't be much under it's sleeves ;)

Gert wrote:So you mostly will have a horizontal scrollbar, some templates will be destroyed by using CodeMirror.

I won't do too much about that. But if some (power) users are happy with it ...

Christoph
Christoph M. Becker---Plugins for CMSimple_XH
cmb
 
Posts: 5484
Joined: Tue Jun 21, 2011 11:04 am
Location: Germany

Re: Syntax Highlighting for CMSimple's back-end ?

Postby bca » Wed Jul 27, 2011 10:07 am

Using Code Editor and have just noticed that when I click "save" then when the screen returns after refreshing there is no syntax highlighting. Its gone!

b
bca
 
Posts: 200
Joined: Tue Sep 15, 2009 4:49 pm

Re: Syntax Highlighting for CMSimple's back-end ?

Postby cmb » Wed Jul 27, 2011 10:22 am

Hello b,

thanks for this report. I've already noticed that and fixed it, but I didn't release a new version, because I wanted to add a few features: a fullscreen mode and some configuration of the code view (behaviour of tabs, switching line numbers on/off, etc.). But unfortunately I had other more urgent stuff to do. :(

For the time being, you can work around this problem by navigating to another page, and switching back to code editor again.

Christoph
Christoph M. Becker---Plugins for CMSimple_XH
cmb
 
Posts: 5484
Joined: Tue Jun 21, 2011 11:04 am
Location: Germany

Previous

Return to Open Development

Who is online

Users browsing this forum: No registered users and 0 guests