Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to add to the "New from Template" list?

Tags:

aptana

I have added a new file template to Aptana Studio 3.0.4 as described in this documentation section: http://wiki.appcelerator.org/display/tis/Creating+a+new+template

The new template now shows up when I select File->New->File and enter an appropriate filename. So far so good.

Now I'd like my new template to show up in the File->New From Template listing. I have not been able to locate any documentation that explains how to do this.

like image 261
Doug Dirks Avatar asked Sep 12 '11 17:09

Doug Dirks


1 Answers

Ok this is actually fairly simple. For my example I will be creating an alternative php file template with a html5 structure.

  1. On the main menu click: Command->PHP->Edit this bundle. You should see a folder named "PHP" appear in your Project Explorer window.
  2. Open the project by double clicking on it and open the folder templates. Inside I see two files: template.php and template.rb
  3. Create the file type you want to add here and name it phpHTML5.php.
  4. Open the newly created file and paste (or create) your template inside and save.
  5. In the same folder open template.rb
  6. Printed at the bottom of the file is the structure:

    template "PHP Template" do |t|
     t.filetype = "*.php"
     t.location = "templates/template.php"
    end
    

Copy and paste it below changing the template to phpHTML5 the following changes:

    template "PHP Template" do |t|
     t.filetype = "*.php"
     t.location = "templates/phpHTML5.php"
    end

7. Save and Restart Aptana.

NOTE: You may 'delete' the project PHP but be careful to deselect the "Delete project contents on disk(cannot be undone)" otherwise you will be in trouble...

Any problems with this just let me know, and I will see if I can help with the rest.

like image 99
samuel.molinski Avatar answered Sep 29 '22 19:09

samuel.molinski