user1209945
user1209945

Reputation: 81

Create Code Snippets in HTML5 Projects with Netbeans IDE

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

Answers (1)

Dave
Dave

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.

NetBeans Palette

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.

Add to Palette Dialog

For you to use this snippet within your HTML file, simply drag the item from the palette into your HTML page.

Upvotes: 2

Related Questions