Smarty-Mode
Manual

[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

6. Templates

In the Smarty Mode, the Smarty functions (like if, while, for, fopen, fclose) are predefined in functions called "Templates".

Each template can be invoked by the function name or by using the SPACE key after the Smarty function name in the buffer (Note, using M-SPACE disable the template).

A template can be aborted by using the C-g or by lefting empty the tempate prompt (in the minibuffer).


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

6.1 Customization

`smarty-electric-mode'

Type: boolean
Default value: `t'
Description: If `t'; enable automatic generation of template. If `nil'; template generators can still be invoked through key bindings and menu. Is indicated in the modeline by "/e" after the mode name and can be toggled by `smarty-electric-mode'.

For a complete description of the template customizable variables, see Templates


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

6.2 Functions


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

6.2.1 Built-in Functions

`smarty-template-capture'

Menu: Smarty -> Templates -> Build-in Functions -> capture
Keybinding: C-c C-t C-b a
Description: See the manual.

`smarty-template-config-load'

Menu: Smarty -> Templates -> Build-in Functions -> config_load
Keybinding: C-c C-t C-b c
Description: See the manual.

`smarty-template-else'

Menu: Smarty -> Templates -> Build-in Functions -> else
Keybinding: C-c C-t C-b M-e
Description: See the manual.

`smarty-template-elseif'

Menu: Smarty -> Templates -> Build-in Functions -> elseif
Keybinding: C-c C-t C-b C-e
Description: See the manual.

`smarty-template-foreach'

Menu: Smarty -> Templates -> Build-in Functions -> foreach
Keybinding: C-c C-t C-b C-f
Description: See the manual.

`smarty-template-foreachelse'

Menu: Smarty -> Templates -> Build-in Functions -> foreachelse
Keybinding: C-c C-t C-b M-f
Description: See the manual.

`smarty-template-if'

Menu: Smarty -> Templates -> Build-in Functions -> if
Keybinding: C-c C-t C-b f
Description: See the manual.

`smarty-template-include'

Menu: Smarty -> Templates -> Build-in Functions -> include
Keybinding: C-c C-t C-b C-i
Description: See the manual.

`smarty-template-include-php'

Menu: Smarty -> Templates -> Build-in Functions -> include_php
Keybinding: C-c C-t C-b M-i
Description: See the manual.

`smarty-template-insert'

Menu: Smarty -> Templates -> Build-in Functions -> insert
Keybinding: C-c C-t C-b i
Description: See the manual.

`smarty-template-ldelim'

Menu: Smarty -> Templates -> Build-in Functions -> ldelim
Keybinding: C-c C-t C-b l
Description: See the manual.

`smarty-template-literal'

Menu: Smarty -> Templates -> Build-in Functions -> literal
Keybinding: C-c C-t C-b C-l
Description: See the manual.

`smarty-template-php'

Menu: Smarty -> Templates -> Build-in Functions -> php
Keybinding: C-c C-t C-b p
Description: See the manual.

`smarty-template-rdelim'

Menu: Smarty -> Templates -> Build-in Functions -> rdelim
Keybinding: C-c C-t C-b r
Description: See the manual.

`smarty-template-section'

Menu: Smarty -> Templates -> Build-in Functions -> section
Keybinding: C-c C-t C-b C-s
Description: See the manual.

`smarty-template-sectionelse'

Menu: Smarty -> Templates -> Build-in Functions -> sectionelse
Keybinding: C-c C-t C-b M-s
Description: See the manual.

`smarty-template-strip'

Menu: Smarty -> Templates -> Build-in Functions -> strip
Keybinding: C-c C-t C-b s
Description: See the manual.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

6.2.2 Custom Functions

`smarty-template-assign'

Menu: Smarty -> Templates -> Custom Functions -> assign
Keybinding: C-c C-t C-c a
Description: See the manual.

`smarty-template-counter'

Menu: Smarty -> Templates -> Custom Functions -> counter
Keybinding: C-c C-t C-c o
Description: See the manual.

`smarty-template-cycle'

Menu: Smarty -> Templates -> Custom Functions -> cycle
Keybinding: C-c C-t C-c c
Description: See the manual.

`smarty-template-debug'

Menu: Smarty -> Templates -> Custom Functions -> debug
Keybinding: C-c C-t C-c d
Description: See the manual.

`smarty-template-eval'

Menu: Smarty -> Templates -> Custom Functions -> eval
Keybinding: C-c C-t C-c e
Description: See the manual.

`smarty-template-fetch'

Menu: Smarty -> Templates -> Custom Functions -> fetch
Keybinding: C-c C-t C-c f
Description: See the manual.

`smarty-template-html-checkboxes'

Menu: Smarty -> Templates -> Custom Functions -> html_checkboxes
Keybinding: C-c C-t C-c C-h c
Description: See the manual.

`smarty-template-html-image'

Menu: Smarty -> Templates -> Custom Functions -> html_image
Keybinding: C-c C-t C-c C-h i
Description: See the manual.

`smarty-template-html-options'

Menu: Smarty -> Templates -> Custom Functions -> html_options
Keybinding: C-c C-t C-c C-h o
Description: See the manual.

`smarty-template-html-radios'

Menu: Smarty -> Templates -> Custom Functions -> html_radios
Keybinding: C-c C-t C-c C-h r
Description: See the manual.

`smarty-template-html-select-date'

Menu: Smarty -> Templates -> Custom Functions -> html_select_date
Keybinding: C-c C-t C-c C-h d
Description: See the manual.

`smarty-template-html-select-time'

Menu: Smarty -> Templates -> Custom Functions -> html_select_time
Keybinding: C-c C-t C-c C-h m
Description: See the manual.

`smarty-template-html-table'

Menu: Smarty -> Templates -> Custom Functions -> html_table
Keybinding: C-c C-t C-c C-h t
Description: See the manual.

`smarty-template-mailto'

Menu: Smarty -> Templates -> Custom Functions -> mailto
Keybinding: C-c C-t C-c i
Description: See the manual.

`smarty-template-math'

Menu: Smarty -> Templates -> Custom Functions -> math
Keybinding: C-c C-t C-c h
Description: See the manual.

`smarty-template-popup'

Menu: Smarty -> Templates -> Custom Functions -> popup
Keybinding: C-c C-t C-c C-p
Description: See the manual.

`smarty-template-popup-init'

Menu: Smarty -> Templates -> Custom Functions -> popup_init
Keybinding: C-c C-t C-c M-p
Description: See the manual.

`smarty-template-textformat'

Menu: Smarty -> Templates -> Custom Functions -> textformat
Keybinding: C-c C-t C-c t
Description: See the manual.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

6.2.3 Variable Modifiers

`smarty-template-capitalize'

Menu: Smarty -> Templates -> Variable Modifiers -> capitalize
Keybinding: C-c C-t C-v p
Description: See the manual.

`smarty-template-cat'

Menu: Smarty -> Templates -> Variable Modifiers -> cat
Keybinding: C-c C-t C-v c
Description: See the manual.

`smarty-template-count-characters'

Menu: Smarty -> Templates -> Variable Modifiers -> count_characters
Keybinding: C-c C-t C-v C-c c
Description: See the manual.

`smarty-template-count-paragraphs'

Menu: Smarty -> Templates -> Variable Modifiers -> count_paragraphs
Keybinding: C-c C-t C-v C-c p
Description: See the manual.

`smarty-template-count-sentences'

Menu: Smarty -> Templates -> Variable Modifiers -> count_sentences
Keybinding: C-c C-t C-v C-c s
Description: See the manual.

`smarty-template-count-words'

Menu: Smarty -> Templates -> Variable Modifiers -> count_words
Keybinding: C-c C-t C-v C-c w
Description: See the manual.

`smarty-template-date-format'

Menu: Smarty -> Templates -> Variable Modifiers -> date_format
Keybinding: C-c C-t C-v f
Description: See the manual.

`smarty-template-default'

Menu: Smarty -> Templates -> Variable Modifiers -> default
Keybinding: C-c C-t C-v d
Description: See the manual.

`smarty-template-escape'

Menu: Smarty -> Templates -> Variable Modifiers -> escape
Keybinding: C-c C-t C-v e
Description: See the manual.

`smarty-template-indent'

Menu: Smarty -> Templates -> Variable Modifiers -> indent
Keybinding: C-c C-t C-v i
Description: See the manual.

`smarty-template-lower'

Menu: Smarty -> Templates -> Variable Modifiers -> lower
Keybinding: C-c C-t C-v l
Description: See the manual.

`smarty-template-nl2br'

Menu: Smarty -> Templates -> Variable Modifiers -> nl2br
Keybinding: C-c C-t C-v n
Description: See the manual.

`smarty-template-regex-replace'

Menu: Smarty -> Templates -> Variable Modifiers -> regex_replace
Keybinding: C-c C-t C-v x
Description: See the manual.

`smarty-template-replace'

Menu: Smarty -> Templates -> Variable Modifiers -> replace
Keybinding: C-c C-t C-v C-p
Description: See the manual.

`smarty-template-spacify'

Menu: Smarty -> Templates -> Variable Modifiers -> spacify
Keybinding: C-c C-t C-v y
Description: See the manual.

`smarty-template-string-format'

Menu: Smarty -> Templates -> Variable Modifiers -> string_format
Keybinding: C-c C-t C-v s
Description: See the manual.

`smarty-template-vstrip'

Menu: Smarty -> Templates -> Variable Modifiers -> strip
Keybinding: C-c C-t C-v C-s
Description: See the manual.

`smarty-template-strip-tags'

Menu: Smarty -> Templates -> Variable Modifiers -> strip_tags
Keybinding: C-c C-t C-v M-s
Description: See the manual.

`smarty-template-truncate'

Menu: Smarty -> Templates -> Variable Modifiers -> truncate
Keybinding: C-c C-t C-v t
Description: See the manual.

`smarty-template-upper'

Menu: Smarty -> Templates -> Variable Modifiers -> upper
Keybinding: C-c C-t C-v u
Description: See the manual.

`smarty-template-wordwrap'

Menu: Smarty -> Templates -> Variable Modifiers -> wordwrap
Keybinding: C-c C-t C-v w
Description: See the manual.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

6.2.4 Plugins Functions


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

6.2.4.1 Smarty Formtool

`smarty-template-formtool-checkall'

Menu: Smarty -> Templates -> Plugins (Functions) -> SmartyFormtool -> formtool_checkall
Keybinding: none
Description: See the plugin manual.

`smarty-template-formtool-copy'

Menu: Smarty -> Templates -> Plugins (Functions) -> SmartyFormtool -> formtool_copy
Keybinding: none
Description: See the plugin manual.

`smarty-template-formtool-count-chars'

Menu: Smarty -> Templates -> Plugins (Functions) -> SmartyFormtool -> formtool_count_chars
Keybinding: none
Description: See the plugin manual.

`smarty-template-formtool-init'

Menu: Smarty -> Templates -> Plugins (Functions) -> SmartyFormtool -> formtool_init
Keybinding: none
Description: See the plugin manual.

`smarty-template-formtool-move'

Menu: Smarty -> Templates -> Plugins (Functions) -> SmartyFormtool -> formtool_move
Keybinding: none
Description: See the plugin manual.

`smarty-template-formtool-moveall'

Menu: Smarty -> Templates -> Plugins (Functions) -> SmartyFormtool -> formtool_moveall
Keybinding: none
Description: See the plugin manual.

`smarty-template-formtool-movedown'

Menu: Smarty -> Templates -> Plugins (Functions) -> SmartyFormtool -> formtool_movedown
Keybinding: none
Description: See the plugin manual.

`smarty-template-formtool-moveup'

Menu: Smarty -> Templates -> Plugins (Functions) -> SmartyFormtool -> formtool_moveup
Keybinding: none
Description: See the plugin manual.

`smarty-template-formtool-remove'

Menu: Smarty -> Templates -> Plugins (Functions) -> SmartyFormtool -> formtool_remove
Keybinding: none
Description: See the plugin manual.

`smarty-template-formtool-rename'

Menu: Smarty -> Templates -> Plugins (Functions) -> SmartyFormtool -> formtool_rename
Keybinding: none
Description: See the plugin manual.

`smarty-template-formtool-save'

Menu: Smarty -> Templates -> Plugins (Functions) -> SmartyFormtool -> formtool_save
Keybinding: none
Description: See the plugin manual.

`smarty-template-formtool-selectall'

Menu: Smarty -> Templates -> Plugins (Functions) -> SmartyFormtool -> formtool_selectall
Keybinding: none
Description: See the plugin manual.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

6.2.4.2 Smarty Paginate

`smarty-template-paginate-first'

Menu: Smarty -> Templates -> Plugins (Functions) -> SmartyPaginate -> paginate_first
Keybinding: none
Description: See the plugin manual.

`smarty-template-paginate-last'

Menu: Smarty -> Templates -> Plugins (Functions) -> SmartyPaginate -> paginate_last
Keybinding: none
Description: See the plugin manual.

`smarty-template-paginate-middle'

Menu: Smarty -> Templates -> Plugins (Functions) -> SmartyPaginate -> paginate_middle
Keybinding: none
Description: See the plugin manual.

`smarty-template-paginate-next'

Menu: Smarty -> Templates -> Plugins (Functions) -> SmartyPaginate -> paginate_next
Keybinding: none
Description: See the plugin manual.

`smarty-template-paginate-prev'

Menu: Smarty -> Templates -> Plugins (Functions) -> SmartyPaginate -> paginate_prev
Keybinding: none
Description: See the plugin manual.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

6.2.4.3 Smarty Validate

`smarty-template-validate'

Menu: Smarty -> Templates -> Plugins (Functions) -> SmartyValidate -> validate
Keybinding: none
Description: See the plugin manual.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

6.2.5 Plugins Variable Modifiers


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

6.2.5.1 AlternativeDateModifierPlugin

`smarty-template-date-formatto'

Menu: Smarty -> Templates -> Plugins (Variable Modifiers) -> AlternativeDateModifierPlugin -> date_format2
Keybinding: none
Description: See the plugin manual.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

6.2.5.2 B2Smilies

`smarty-template-btosmilies'

Menu: Smarty -> Templates -> Plugins (Variable Modifers) -> B2Smilies -> B2Smilies
Keybinding: none
Description: See the plugin manual.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

6.2.5.3 bbcode2html

`smarty-template-bbcodetohtml'

Menu: Smarty -> Templates -> Plugins (Variable Modifers) -> BBCodePlugin -> bbcode2html
Keybinding: none
Description: See the plugin manual.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

6.2.6 Non-Smarty Functions

`smarty-template-header'

Menu: Smarty -> Templates -> Insert Header
Keybinding: C-c C-t C-h
Description: This function is used to insert a header in the current buffer.

`smarty-template-footer'

Menu: Smarty -> Templates -> Insert Footer
Keybinding: C-c C-t C-f
Description: This function is used to insert a footer in the current buffer.

`smarty-template-insert-date'

Menu: Smarty -> Templates -> Insert Date
Keybinding: C-c C-t C-d i
Description: This function is used to insert the date in the current buffer.

`smarty-template-modify'

Menu: Smarty -> Templates -> Modify Date
Keybinding: C-c C-t C-d m
Description: This function is used to modify the last modification date in the current buffer.


[ << ] [ >> ]           [Top] [Contents] [Index] [ ? ]