Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Language IDEs » PHP Development Tools (PDT) » Default html doctype(How to change the html doctype for php files, which is by default html5?)
Default html doctype [message #695188] Mon, 11 July 2011 08:37 Go to next message
Michele Locati is currently offline Michele Locati
Messages: 5
Registered: July 2011
Location: Como, Italy
Junior Member
I've just update to Eclipse Indigo with PDT 3.0.0.v20110516.

My php files contains some html and Eclipse reports errors for many of them since they use pre-html5 elements (eg the "cellspacing" attribute of "table").
Since my projects are still targeted to html4, is there a way to specify the doctype for these php files?

Thank you
Michele
Re: Default html doctype [message #695525 is a reply to message #695188] Mon, 11 July 2011 23:09 Go to previous messageGo to next message
Toshihiro Izumi is currently offline Toshihiro Izumi
Messages: 353
Registered: July 2009
Location: Japan
Senior Member
Unorthodox method:

1. Select html file in PHP Explorer.(if there is no html file, create new one)
2. Right-click > Properties > Web Content Settings.
3. Choose preferred doctype in Document type list.
4. Click OK and exit eclipse.
5. Open {your_workspace}/{your_project}/.settings/org.eclipse.wst.html.core.prefs with text editor.
6. Replace
document-type/{your_file_name}=...
by
document-type/<project>=...
(do not modify "<project>")
7. Start eclipse.

Orthodox method:

<skip since I don't recommend>
Re: Default html doctype [message #695612 is a reply to message #695525] Tue, 12 July 2011 06:47 Go to previous messageGo to next message
Michele Locati is currently offline Michele Locati
Messages: 5
Registered: July 2011
Location: Como, Italy
Junior Member
Thanks Toshihiro! It worked!
Initially I thought it didn't, since my php files were still reporting html5 validation errors even after a "Refresh" (F5).
But I forced a full rebuild of the project by doing this unorthodox method:
1. I opened one of the php files
2. Select all->Cut (so the file has been emptied)
3. Saved the file
4. Pasted in in its previous content
5. Saved it
Eclipse started a rebuild progess and all the validation errors disappeared, in all the php files.

Thanks a lot!

[Updated on: Tue, 12 July 2011 06:47]

Report message to a moderator

Re: Default html doctype [message #695630 is a reply to message #695612] Tue, 12 July 2011 07:53 Go to previous message
Toshihiro Izumi is currently offline Toshihiro Izumi
Messages: 353
Registered: July 2009
Location: Japan
Senior Member
Ah, you're able to validate manually by
Right-click on project or folder or file > Validate
Razz
Previous Topic:eclipse project sharing
Next Topic:Eclipse for PHP Developers is not avilable for download
Goto Forum:
  


Current Time: Fri Oct 31 09:56:58 GMT 2014

Powered by FUDForum. Page generated in 0.03018 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software