Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Eclipse HTML editor for HTML template files

I'm trying to edit phpbb HTML template file with Eclipse Ganymedes version 3.4.1 containing Web Developer Tools.

These template files contain HTML markup with template variable marks in form {variable_name}. Now, when trying to open such file, Eclipse trys to validate also these template variable marks.

For example template contains

<meta http-equiv="content-type" content="text/html; charset={S_CONTENT_ENCODING}" /> 

After opening Eclipse shows on editor body:

Unsupported Character Body
Character encoding "{S_CONTENT_ENCODING}" is not supported by this platform.
<button>Set encoding...</button>

How to solve this using WTP or is there any better editor for template editing purpose ?

like image 754
user122644 Avatar asked Sep 08 '09 02:09

user122644


People also ask

How do I edit an HTML file in Eclipse?

Right click on the html/htm file, go to "open with" and select "HTML editor".

Does Eclipse have HTML editor?

1.1 HTML Editor Eclipse HTML Editor is an Eclipse plugin for HTML , JSP , and XML editing and has the following features: HTML , JSP , XML , CSS , DTD , and JavaScript colored highlighting. HTML and JSP preview. JSP and XML validation.


2 Answers

Eclipse is trying to determine the text encoding from your meta tags and fails.

To override this behavior open the file in eclipse so you can see the error. Open the File menu and choose Properties (Alt-Enter) and eclipse will show you the properties dialog for the file where you can change the text file encoding.

I don't know if this can be disabled for all the files.

like image 156
Serxipc Avatar answered Oct 11 '22 01:10

Serxipc


I've never used Eclipse on Linux, but it looks like the problem isn't really about Eclipse supporting variables -- it's about it trying to render what a character set that it thinks is called "{S_CONTENT_ENCODING}"

You can probably get around the problem by changing {S_CONTENT_ENCODING} to utf-8 (or latin-1 or whatever) in all of your templates. (This assumes that you aren't changing encoding from one template to the next, but I really doubt you are.)

Copy-paste utf-8 where you see {S_CONTENT_ENCODING} in one of the templates, and Eclipse should handle it the other {foo} instances from there.

like image 45
anschauung Avatar answered Oct 11 '22 02:10

anschauung