Reputation: 81
Is there a way to create reusable code snippets in HTML5 projects with Netbeans? I believe in Dreamweaver it's called a Library Item. Basically I have snippets of code (header, footer, nav, ect) that I need to use across the whole site as well as little modules that will show up on specific pages. Is there a way to achieve this in Netbeans? I've read about creating a template but I'm not sure that's what I'm looking for.
Thanks!
Upvotes: 1
Views: 939
Reputation: 1313
You can achieve this by using the Palette within NetBeans.
If you have a HTML file project, you can open the Palette (select Window | IDE Tools | Palette) from the main menu. The palette window will then open at the right hand side of NetBeans. A default palette has HTML and HTML forms options within it.
You can then select some code from within your HTML file and drag it onto the palette. At this point, NetBeans will display the Add to Palette dialog asking you for a name that you wish to give to this snippet, a tooltip and optionally an icon that will be displayed within the palette.
For you to use this snippet within your HTML file, simply drag the item from the palette into your HTML page.
Upvotes: 2