[xwiki-users] Using Velocity to generate HTML
Hi, I created a velocity macro and called it like this. {{velocity}} $services.xtestprogress.render() {{/velocity}} It happens that all <link/> -Tags inserted in the render method are removed in the resulting website. Any ideas? Thanks, Stefan.
2012/2/29 Grüner Heinrich <[email protected]>:
Hi,
I created a velocity macro and called it like this. {{velocity}} $services.xtestprogress.render() {{/velocity}}
It happens that all <link/> -Tags inserted in the render method are removed in the resulting website. Any ideas?
content generated by velocity is seen as wiki content by default (unless you use wiki="false" and in this case it's plain text) so anything that is not wiki syntax is properly escaped. If you want to insert html content you need to use {{html}} macro. See http://extensions.xwiki.org/xwiki/bin/view/Extension/HTML+Macro
Thanks, Stefan.
_______________________________________________ users mailing list [email protected] http://lists.xwiki.org/mailman/listinfo/users
-- Thomas Mortagne
Hi, On Feb 29, 2012, at 10:38 AM, Grüner Heinrich wrote:
Hi,
I created a velocity macro and called it like this. {{velocity}} $services.xtestprogress.render() {{/velocity}}
It happens that all <link/> -Tags inserted in the render method are removed in the resulting website. Any ideas?
If you wish to insert HTML you need to use the HTML macro: http://extensions.xwiki.org/xwiki/bin/view/Extension/HTML+Macro Thanks -Vincent
Sorry Vincent, sorry Thomas but I didn't get it. What do you mean? The html content is rendered into the page, but without all stylesheet-information. Am 29.02.2012 10:42, schrieb Thomas Mortagne:
2012/2/29 Grüner Heinrich<[email protected]>:
Hi,
I created a velocity macro and called it like this. {{velocity}} $services.xtestprogress.render() {{/velocity}}
It happens that all<link/> -Tags inserted in the render method are removed in the resulting website. Any ideas? content generated by velocity is seen as wiki content by default (unless you use wiki="false" and in this case it's plain text) so anything that is not wiki syntax is properly escaped. If you want to insert html content you need to use {{html}} macro.
See http://extensions.xwiki.org/xwiki/bin/view/Extension/HTML+Macro
Thanks, Stefan.
_______________________________________________ users mailing list [email protected] http://lists.xwiki.org/mailman/listinfo/users
Am 29.02.2012 10:41, schrieb Vincent Massol:
Hi,
On Feb 29, 2012, at 10:38 AM, Grüner Heinrich wrote:
Hi,
I created a velocity macro and called it like this. {{velocity}} $services.xtestprogress.render() {{/velocity}}
It happens that all<link/> -Tags inserted in the render method are removed in the resulting website. Any ideas? If you wish to insert HTML you need to use the HTML macro: http://extensions.xwiki.org/xwiki/bin/view/Extension/HTML+Macro
Thanks -Vincent
As I said the result of velocity execution is seen as wiki content which mean that if you have anything in you content that mean something as wiki syntax is will be interpreted as such. If you want to be sure you get exactly what was produced by the velocity script use {{velocity wiki="false"}} instead of {{velocity}}. But again this is displaying you html, it's not inserting html as part of the html content. If that's what you want then fine, you might want to improve it a little by using the code macro which will do a syntax highlight of your html content in a box. 2012/2/29 Grüner Heinrich <[email protected]>:
Sorry Vincent, sorry Thomas but I didn't get it. What do you mean? The html content is rendered into the page, but without all stylesheet-information.
Am 29.02.2012 10:42, schrieb Thomas Mortagne:
2012/2/29 Grüner Heinrich<[email protected]>:
Hi,
I created a velocity macro and called it like this. {{velocity}} $services.xtestprogress.render() {{/velocity}}
It happens that all<link/> -Tags inserted in the render method are removed in the resulting website. Any ideas?
content generated by velocity is seen as wiki content by default
(unless you use wiki="false" and in this case it's plain text) so anything that is not wiki syntax is properly escaped. If you want to insert html content you need to use {{html}} macro.
See http://extensions.xwiki.org/xwiki/bin/view/Extension/HTML+Macro
Thanks, Stefan.
_______________________________________________ users mailing list [email protected] http://lists.xwiki.org/mailman/listinfo/users
Am 29.02.2012 10:41, schrieb Vincent Massol:
Hi,
On Feb 29, 2012, at 10:38 AM, Grüner Heinrich wrote:
Hi,
I created a velocity macro and called it like this. {{velocity}} $services.xtestprogress.render() {{/velocity}}
It happens that all<link/> -Tags inserted in the render method are removed in the resulting website. Any ideas?
If you wish to insert HTML you need to use the HTML macro: http://extensions.xwiki.org/xwiki/bin/view/Extension/HTML+Macro
Thanks -Vincent
_______________________________________________ users mailing list [email protected] http://lists.xwiki.org/mailman/listinfo/users
-- Thomas Mortagne
Hi Thomas, any chance that I hit a bug? My code is like This: {{velocity wiki="false"}} $services.xtestprogress.render() {{/velocity}} And the page rendered looks Like This: Am 29.02.2012 11:21, schrieb Thomas Mortagne:
As I said the result of velocity execution is seen as wiki content which mean that if you have anything in you content that mean something as wiki syntax is will be interpreted as such. If you want to be sure you get exactly what was produced by the velocity script use {{velocity wiki="false"}} instead of {{velocity}}.
But again this is displaying you html, it's not inserting html as part of the html content. If that's what you want then fine, you might want to improve it a little by using the code macro which will do a syntax highlight of your html content in a box.
2012/2/29 Grüner Heinrich<[email protected]>:
Sorry Vincent, sorry Thomas but I didn't get it. What do you mean? The html content is rendered into the page, but without all stylesheet-information.
Am 29.02.2012 10:42, schrieb Thomas Mortagne:
2012/2/29 Grüner Heinrich<[email protected]>:
Hi,
I created a velocity macro and called it like this. {{velocity}} $services.xtestprogress.render() {{/velocity}}
It happens that all<link/> -Tags inserted in the render method are removed in the resulting website. Any ideas? content generated by velocity is seen as wiki content by default
(unless you use wiki="false" and in this case it's plain text) so anything that is not wiki syntax is properly escaped. If you want to insert html content you need to use {{html}} macro.
See http://extensions.xwiki.org/xwiki/bin/view/Extension/HTML+Macro
Thanks, Stefan.
_______________________________________________ users mailing list [email protected] http://lists.xwiki.org/mailman/listinfo/users
Am 29.02.2012 10:41, schrieb Vincent Massol:
Hi,
On Feb 29, 2012, at 10:38 AM, Grüner Heinrich wrote:
Hi,
I created a velocity macro and called it like this. {{velocity}} $services.xtestprogress.render() {{/velocity}}
It happens that all<link/> -Tags inserted in the render method are removed in the resulting website. Any ideas? If you wish to insert HTML you need to use the HTML macro: http://extensions.xwiki.org/xwiki/bin/view/Extension/HTML+Macro
Thanks -Vincent
_______________________________________________ users mailing list [email protected] http://lists.xwiki.org/mailman/listinfo/users
You get empty result or you forgot something ? What I can tel you is that {{velocity wiki="false"}} $services.xtestprogress.render() {{/velocity}} will display you the exact result of $services.xtestprogress.render() execution. 2012/2/29 Grüner Heinrich <[email protected]>:
Hi Thomas,
any chance that I hit a bug? My code is like This:
{{velocity wiki="false"}} $services.xtestprogress.render() {{/velocity}}
And the page rendered looks Like This:
Am 29.02.2012 11:21, schrieb Thomas Mortagne:
As I said the result of velocity execution is seen as wiki content which mean that if you have anything in you content that mean something as wiki syntax is will be interpreted as such. If you want to be sure you get exactly what was produced by the velocity script use {{velocity wiki="false"}} instead of {{velocity}}.
But again this is displaying you html, it's not inserting html as part of the html content. If that's what you want then fine, you might want to improve it a little by using the code macro which will do a syntax highlight of your html content in a box.
2012/2/29 Grüner Heinrich<[email protected]>:
Sorry Vincent, sorry Thomas but I didn't get it. What do you mean? The html content is rendered into the page, but without all stylesheet-information.
Am 29.02.2012 10:42, schrieb Thomas Mortagne:
2012/2/29 Grüner Heinrich<[email protected]>:
Hi,
I created a velocity macro and called it like this. {{velocity}} $services.xtestprogress.render() {{/velocity}}
It happens that all<link/> -Tags inserted in the render method are removed in the resulting website. Any ideas?
content generated by velocity is seen as wiki content by default
(unless you use wiki="false" and in this case it's plain text) so anything that is not wiki syntax is properly escaped. If you want to insert html content you need to use {{html}} macro.
See http://extensions.xwiki.org/xwiki/bin/view/Extension/HTML+Macro
Thanks, Stefan.
_______________________________________________ users mailing list [email protected] http://lists.xwiki.org/mailman/listinfo/users
Am 29.02.2012 10:41, schrieb Vincent Massol:
Hi,
On Feb 29, 2012, at 10:38 AM, Grüner Heinrich wrote:
Hi,
I created a velocity macro and called it like this. {{velocity}} $services.xtestprogress.render() {{/velocity}}
It happens that all<link/> -Tags inserted in the render method are removed in the resulting website. Any ideas?
If you wish to insert HTML you need to use the HTML macro: http://extensions.xwiki.org/xwiki/bin/view/Extension/HTML+Macro
Thanks -Vincent
_______________________________________________ users mailing list [email protected] http://lists.xwiki.org/mailman/listinfo/users
_______________________________________________ users mailing list [email protected] http://lists.xwiki.org/mailman/listinfo/users
-- Thomas Mortagne
participants (3)
-
Grüner Heinrich -
Thomas Mortagne -
Vincent Massol