+ Start a Discussion
ClintHegneyClintHegney 

DOCTYPE issue with SControls created using AppExchange plugin for Eclipse

Code:
Has anyone noticed that the default DOCTYPE inserted when 
creating a new SControl in Eclipse causes issues with 
Salesforce CSS, particularly with the detail tables— Here 
is the default DOCTYPE.

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">

Now I was able to make some changes to the DOCTYPE that 
fixed the issues. Here is the fixed DOCTYPE.

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">

Does anyone know why this is happening or how I can 
change the template so that the fix DOCTYPE is 
automatically inserted–


 
SteveBowerSteveBower
Eclipse:

Window, Preferences, Web and HTML, HTML Files

Then you're brought to a dialog box which lists the names of the installed templates.

I've got:  New HTML File (4.01 transitional)  as one.  Edit it to include the DOCTYPE System Reference that you want.  You can replace the existing template, save a new one, etc.  But I think it's easier to just edit the existing one.

I suppose we should all be using "Strict", but I haven't bothered trying to see what works and doesn't work if you really try to be totally strict about it.

I think it would be cool if you were to report problems with strict usage to SFDC as a bug, so we can encourage the migration over time.  I wonder how willing people would be to totally give up the "classic" mode.

Steve.

ClintHegneyClintHegney
Editing templates in the location you referenced doesn't change what is used when a new SControl is created. Is there someplace in Eclipse that needs to be changed specifically for the AppExchange plugin?
SteveBowerSteveBower
Sigh, you're right.  I'm sorry.

The SFDC guys should have done a nicer job of it and used the templates, but instead, they include their own in the .jar file.  I think I didn't notice because I tend to copy from one s-control to another to get started instead of creating one from scratch.  I went and looked at my setups and there it was, so I replied.

So, if you go to the eclipse workspace, and look for the plugins, you'll see the com.appexchange.toolkit_1.0.2206.jar file.  

In there, there is a file: com/appexchange/plugin/template/file/SControl.template

Which is the template used when creating a new S-Control.  Replacing that is a subject that's probably not worth it here.  Perhaps the SFDC guys could use the normal Eclipse template mechanism over time.

Steve Bower.



Ron HessRon Hess
With eclipse, i've started using the Snipits feature.  I take an scontrol that has lots of re-usable code blocks ( like the header and init) , select and drag code into the snipit tool area and give these names.

Then i can drop them into each new project easily.
ClintHegneyClintHegney
Thanks for the reply. Yes, the ability setup your own S-Control templates using the templates mechanism in Eclipse would be a very nice feature to have. However, Mr. Hess came up with a very nice idea using snippets. It actually looks like it works very well and I can setup different snippets for different things. Like if I am creating an Opportunity S-Control and I want to insert a body tag that is going to use the class "opportunity" to use that tabs icon and colors, then I just double click on the snippet I created for that class. I can do the same thing for inserting field tables styled like Salesforce tabs.