This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 183360 - Smarty plug-in doesn't work with custom templates
Summary: Smarty plug-in doesn't work with custom templates
Status: RESOLVED FIXED
Alias: None
Product: php
Classification: Unclassified
Component: Smarty (show other bugs)
Version: 6.x
Hardware: PC Windows XP
: P3 normal (vote)
Assignee: Martin Fousek
URL:
Keywords:
: 187949 (view as bug list)
Depends on:
Blocks:
 
Reported: 2010-04-01 14:22 UTC by marcusson
Modified: 2012-08-28 02:37 UTC (History)
1 user (show)

See Also:
Issue Type: ENHANCEMENT
Exception Reporter:


Attachments
Smarty code template file (24.82 KB, application/xml)
2010-04-01 14:22 UTC, marcusson
Details

Note You need to log in before you can comment on or make changes to this bug.
Description marcusson 2010-04-01 14:22:11 UTC
Created attachment 96541 [details]
Smarty code template file

I added custom code templates to the Smarty plug-in. However: they are ignored completely.

- *.tpl files are associated with MIME-type x-tpl in NetBeans IDE
- org-netbeans-modules-editor-settings-CustomCodeTemplates.xml (see attachment) is stored in config/Editors/text/x-tpl/CodeTemplates
- I tested the templates without the Smarty plug-in and they do work!

- BTW: HTML code temlates are not available either

Possible cause: templates may consist of multiple parts including: CSS, (X)HTML, JavaScript, PHP and Smarty. May be the editor doesn't recognize it is in a Smarty context and thus ignores the templates?

Aside note: I know work on auto-completion is still underway. The file attached contains a list of all available Smarty functions and modifiers.
If this list is useful to you, use it for whatever purpose. It's may own work and I hereby declare it public domain.
Comment 1 Martin Fousek 2010-04-10 07:43:46 UTC
I was able to reproduce it.
Well, I am not sure if it will be related to mentioned cause, the language embedding should take care about that. It seems rather as a bad registration of code templates. I will take a look on that soon.

By the way, thank you for the list. Now I will preffere work on code completion, but it's possible that I will add it there later.
Comment 2 Martin Fousek 2010-05-20 13:05:32 UTC
Ok, it tried it again with the plugin version 1.26 and there are working code templates for embedded languages. So you should be able to call HTML outside smarty delimiters and also PHP code templates inside {php}{/php} tags.

There aren't working just the TPL code templates which aren't supported for now. So I'm changing type of this issue to enhancement. Thanks for reporting that but I'm afraid that code completion will be more preferred feature for now, so this will have turn later.
Comment 3 Martin Fousek 2010-06-23 08:07:22 UTC
*** Bug 187949 has been marked as a duplicate of this bug. ***
Comment 4 Martin Fousek 2012-08-27 06:57:01 UTC
Implemented in web-main #a1447f4e3665.

Code templetes inside/outside smarty tags will work to you in NB7.3. By the way there will be provided also many of standards templates by default. You can define another custom ones in Options->Editor->code Templates and Smarty Markup, Smarty Templates.
Comment 5 Quality Engineering 2012-08-28 02:37:55 UTC
Integrated into 'main-golden', will be available in build *201208280001* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)
Changeset: http://hg.netbeans.org/main-golden/rev/e15c1e777f7d
User: Martin Fousek <marfous@netbeans.org>
Log: #183360 - Smarty plug-in doesn't work with custom templates