Mayfield Global Knowledge Center



How do I add custom templates to the right-click Create Document context menu?

In this article, we will be adding a new item to the Create Document option of the right-click context menu. The item we add will allow us to easily create a new file with the extension .html.

  1. From the desktop, press Alt+F2 to launch the Run Application window.
  2. Type: gnome-terminal then press Enter. This will launch a user terminal (similar to Windows command prompt).
  3. In the termianl, typemkdir ~/Templates then press Enter. This creates a new directory called Templates in your home directory.
  4. Type:cd Templates then press Enter. You are now in the Templates directory.
  5. Type:touch html_doc.htmlthen press Enter. This creates an empty HTML document called html_doc.html.
  6. Right-click an empty area of your desktop and select Create Document > html_doc. A new HTML file will magically appear.
  7. Repeat this process to add additional templates. For example, to add a PHP template you would simply type:touch ~/Templates/php_doc.phpthen press Enter. You will now have the option php_doc.
  8. You can also add sub-menus to the Create Document option. To do this, you would simply create a sub-folder inside the Templates directory. For example, let's say you want to consolidate your HTML and PHP templates into a Create Document sub-menu called WebDev.
  9. You would type:mkdir ~/Templates/WebDevthen press Enter.
  10. Next, move your existing templates to the new WebDev directory by typing:mv Templates/*doc* Templates/WebDev/then pressing Enter. Now you can right-click an area of the desktop (or Nautilus) and select Create Document > WebDev to access your HTML and PHP templates.

Would you like to...


del.icio.us

Print this page Print this page

Email this page Email this page

Post a comment Post a comment

Subscribe me

Add to favoritesAdd to favorites

User Opinions (42 votes)

95% thumbs up 4% thumbs down

How would you rate this answer?

Helpful
Not helpful
Thank you for rating this answer.