You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/en/How-To-Create-Edit-Power-Tools-Templates.md
+63-3Lines changed: 63 additions & 3 deletions
Original file line number
Diff line number
Diff line change
@@ -18,10 +18,70 @@ If you want to edit any file, copy it in the same directory and change it's an e
18
18
19
19
## Create New Templates
20
20
21
-
To create new templates, simply add a new file to the `FileTemplates` directory. You can use the existing templates as a reference. For guidance on how templates function and how to use placeholders, please refer to the documentation provided at [Understanding Power Tools Templates](power-tools-understanding-power-tools-templates.md).
21
+
Choose a folder under the `FileTemplates` directory based on where the file you're creating in your project will reside (e.g., `Server`, `Client` -> `Mvc` or `Angular`, `Test`). Then, create a folder named after the file you’re creating. Inside this folder, create the following three files: `MainTemplate.txt`, `PartialTemplates.txt`, and `TemplateInfo.txt`.
22
+
23
+
You can use the existing templates as a reference. For guidance on how templates function and how to use placeholders, please refer to the documentation provided at [Understanding Power Tools Templates](power-tools-understanding-power-tools-templates.md).
22
24
23
25
Power Tools discovers templates in the `FileTemplates` directory every time it is run. So, restarting Power Tools will find your newly created templates.
24
26
25
-
## Change Destination Path Of New Files
27
+
### Example Custom Template
28
+
29
+
Let's say you want to create a new template for generating a new class in the `*.Core.Shared` project. It is an entity constant class that contains some constant values. Here is how you can create a new template for this:
30
+
31
+
1. Create a new folder named `CustomTemplate` under `AspNetZeroRadTool/FileTemplates/Server` directory.
32
+
> Hint: You can use a prefix like ANZ to group your templates. For example, `ANZ_CustomTemplate`. Or refoldering, for example `FileTemplates\Server\MyTemplates\ANZ_CustomTemplate` This will help you to find your templates easily.
33
+
34
+
2. Create `MainTemplate.txt`, `PartialTemplates.txt`, and `TemplateInfo.txt` files inside the `ConstantClass` folder.
To change the destination path of a template, find the template folder of it in `AspNetZeroRadTool/FileTemplates` directory and edit the content of `TemplateInfo.txt` file.
0 commit comments