[jira] [Reopened] (VELOCITY-865) I am new velocity .

2017-11-02 Thread Michael Osipov (JIRA)

 [ 
https://issues.apache.org/jira/browse/VELOCITY-865?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Michael Osipov reopened VELOCITY-865:
-

> I am new velocity . 
> 
>
> Key: VELOCITY-865
> URL: https://issues.apache.org/jira/browse/VELOCITY-865
> Project: Velocity
>  Issue Type: New Feature
>  Components: Documentation
>Affects Versions: 1.7.x
>Reporter: phuongphally
>Priority: Major
> Fix For: 1.7.x
>
>
> I am new velocity. I need explain from you. please help me please , I don't 
> know why we need to use it.



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)

-
To unsubscribe, e-mail: dev-unsubscr...@velocity.apache.org
For additional commands, e-mail: dev-h...@velocity.apache.org



[jira] [Updated] (VELOCITY-885) 希望 Velocity-tools-layout 能够增加 #block()、#super() 模板指令

2017-11-02 Thread Michael Osipov (JIRA)

 [ 
https://issues.apache.org/jira/browse/VELOCITY-885?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Michael Osipov updated VELOCITY-885:

Affects Version/s: (was: 2.1.x)
   2.0

> 希望 Velocity-tools-layout 能够增加 #block()、#super() 模板指令
> 
>
> Key: VELOCITY-885
> URL: https://issues.apache.org/jira/browse/VELOCITY-885
> Project: Velocity
>  Issue Type: New Feature
>  Components: Engine
>Affects Versions: 2.0
>Reporter: Wang yongshan
>Priority: Minor
>
> 我在使用 Python 模板引擎 Jinja2(http://jinja.pocoo.org/)时,发现 Jinja2 的 *{% block title 
> %} Default title {% endblock %}* 和  *{{ super() }}* 语法特性在 Layout 继承时非常有用,例如:
> *default-layout.html*
> {code:html}
> 
>   {% block title %}Default title{% endblock %}
>   {% block head %}
> 
>   {% endblock %}
> 
> 
> {% block content %} {% endblock %}
> 
> {code}
> *child.html*
> {code:html}
> {% extends "default-layout.html" %}
> {% block title %}User Manager{% endblock %}
> {% block head %}
>{{ super() }}
>
>.important {font-size:20px;font-weight:bold;}
>
> {% endblock %}
> {% block content %}
> User Manager
> ...
> {% endblock %}
> {code}
> 这种特性在 *局部大块内容进行复用/替换* 时非常有用,能提高 Web 页面的开发效率和减少一定的代码量。
> 因此,我在 Velocity-1.7.x 中进行了修改,增加了: *#block()  #end* 、*#override() #end* 和 
> *#super()* 指令,用法如下:
> *default-layout.html*
> {code:html}
> 
>   #block("title") Default title #end
>   #block("head")
> 
>   #end
> 
> 
> $!{ screen_content }
> 
> {code}
> *child.html*
> {code:html}
> #override("title") User Manager #end
> #override("head") 
>#super()
>
>.important {font-size:20px;font-weight:bold;}
>
> #end
> User Manager
> ...
> {code}
> 希望 Velocity-2.x 后面也能够增加类似 Jinja2 的 block、super 等指令。
> 祝愿 Velocity 越来越好!



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)

-
To unsubscribe, e-mail: dev-unsubscr...@velocity.apache.org
For additional commands, e-mail: dev-h...@velocity.apache.org



[jira] [Closed] (VELOCITY-885) 希望 Velocity-tools-layout 能够增加 #block()、#super() 模板指令

2017-11-02 Thread Michael Osipov (JIRA)

 [ 
https://issues.apache.org/jira/browse/VELOCITY-885?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Michael Osipov closed VELOCITY-885.
---
   Resolution: Invalid
Fix Version/s: (was: 2.1.x)

In English please.

> 希望 Velocity-tools-layout 能够增加 #block()、#super() 模板指令
> 
>
> Key: VELOCITY-885
> URL: https://issues.apache.org/jira/browse/VELOCITY-885
> Project: Velocity
>  Issue Type: New Feature
>  Components: Engine
>Affects Versions: 2.0
>Reporter: Wang yongshan
>Priority: Minor
>
> 我在使用 Python 模板引擎 Jinja2(http://jinja.pocoo.org/)时,发现 Jinja2 的 *{% block title 
> %} Default title {% endblock %}* 和  *{{ super() }}* 语法特性在 Layout 继承时非常有用,例如:
> *default-layout.html*
> {code:html}
> 
>   {% block title %}Default title{% endblock %}
>   {% block head %}
> 
>   {% endblock %}
> 
> 
> {% block content %} {% endblock %}
> 
> {code}
> *child.html*
> {code:html}
> {% extends "default-layout.html" %}
> {% block title %}User Manager{% endblock %}
> {% block head %}
>{{ super() }}
>
>.important {font-size:20px;font-weight:bold;}
>
> {% endblock %}
> {% block content %}
> User Manager
> ...
> {% endblock %}
> {code}
> 这种特性在 *局部大块内容进行复用/替换* 时非常有用,能提高 Web 页面的开发效率和减少一定的代码量。
> 因此,我在 Velocity-1.7.x 中进行了修改,增加了: *#block()  #end* 、*#override() #end* 和 
> *#super()* 指令,用法如下:
> *default-layout.html*
> {code:html}
> 
>   #block("title") Default title #end
>   #block("head")
> 
>   #end
> 
> 
> $!{ screen_content }
> 
> {code}
> *child.html*
> {code:html}
> #override("title") User Manager #end
> #override("head") 
>#super()
>
>.important {font-size:20px;font-weight:bold;}
>
> #end
> User Manager
> ...
> {code}
> 希望 Velocity-2.x 后面也能够增加类似 Jinja2 的 block、super 等指令。
> 祝愿 Velocity 越来越好!



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)

-
To unsubscribe, e-mail: dev-unsubscr...@velocity.apache.org
For additional commands, e-mail: dev-h...@velocity.apache.org