Page 1 of 1

Custom templates: Use Editor→Templates or Document Type Asso

Posted: Thu Nov 18, 2010 5:47 pm
by Zearin
I believe I am a victim of Oxygen’s awesome customizability. :)



In Preferences, there are options to specify a custom templates directory in Editor→Templates. Alternatively, you can also go into Document Type Associations, select a document type, and provide custom templates.

I have been using the Editor→Templates option until now. However, my ideal setup would be the following:
  • When I select “New Document…” if I have a custom template, I want to see my custom template instead of the default template(s) provided by Oxygen.
  • I do not want to perform any modification or destruction of the Oxygen’s frameworks. I want to override them on an “opt-in” basis.
  • Motivations: For my most common document types, I want to have a new document pre-populated with more XML namespaces, comments, and perhaps include a tiny bit of XML to help me remember to use Best Practices. (It’s always easier to create a new document and remove any of these items if I don’t want them than it is to create a new document and have to remember to add in all these things.) :)
I have always browsed through the options of the Document Type Associations preferences and been inspired and impressed by the customizability. At the same time, I am also intimidated by them, because I am not sure what many of them mean.

For example, in Document Type Associations→XHTML, I think I understand the settings for Schema and CSS, but I have absolutely no idea what the Classpath is for. I mean, I know it’s a path to a Java file, but I don’t know what the purpose of that Java file is, or if it would continue to function normally if I mess with any content in the other tabs. And under the Transformation tab, there are several transformations that I never use. I would like to hide them, but I don’t want to delete anything or perform any actions that cannot be undone at a future date if I find a need for those transformations later.

Also, do templates specified in Document Type Associations override (or become overriden) by templates in Editor→Templates?

Customization Sage wanted! 8)

Re: Custom templates: Use Editor→Templates or Document Type Asso

Posted: Fri Nov 19, 2010 5:54 pm
by adrian
Hello,

In short, no templates are ever overridden by specifying other templates from a different option. Each of the template sources contributes to the list of templates.

The sources of templates are:
- The "templates" folder from the Oxygen installation folder.
- The folders from the list in Options -> Preferences -> Editor -> Templates -> Document Templates.
- the template folders from each of the document types: Options -> Preferences -> Document Type Association, select document type, Edit, Templates tab

If you want to change the templates(template folders) of some of the Document Types you can edit them(duplicate them if you want to preserve the original) and edit/remove their template folders.

Duplicate a document type and edit the copy. Disable the original if you want to keep it untouched and non-interfering.

If you want to completely disable a document type simply clear its checkbox from Options -> Preferences -> Document Type Association.
I have always browsed through the options of the Document Type Associations preferences and been inspired and impressed by the customizability. At the same time, I am also intimidated by them, because I am not sure what many of them mean.
It's true that some of the options from the Document Type editing dialog aren't documented individually and can look scary.

The documentation for this part of the application was meant as a guide for starting a document type customization from scratch. However, people find this exact thing overwhelming so they would rather tinker with various options from an existing framework and this is where the documentation isn't very helpful.

The guide is part of the Oxygen user manual:
http://www.oxygenxml.com/doc/ug-oxygen/ ... intro.html
This may help in explaining some things from the interface but it requires some extensive reading.

I'll add a request to our issue tracking tool to improve the documentation on a per-option level to be more tinker-friendly.

Let me know if you still need clarification on any of these options.

Regards,
Adrian