Re: [xwiki-users] Display macro

2016-10-12 Thread Eduard Moraru
The only issue that I know of is related to the include macro in the sense
that it does work when called from a velocity block, but it may not work
when you expect it to. The problematic usecase is when you may do something
like this:
{{velocity}}
{{include reference="document defining some velocity variables or macros"}}
#callMacroDefinedInIncludedDoc()
{{/velocity}}

In the above case, the order of execution may mess with your expectations,
since velocity would execute first and the called macro is not yet
defined/known at that moment. The fix for such a situation is to call the
include before (and outside of) the velocity macro.

Thanks,
Eduard

On Fri, Oct 7, 2016 at 6:51 PM, Gerritjan Koekkoek <gerrit...@cdlsworld.org>
wrote:

> Hi Vincent,
>
>
> I must admit the extension Include-macro en Display-macro documentation
> does not contain any suggestion that it does not work.
>
>
> I posted my question as I'm very sure I came across this statement that it
> would not work in some doc I found via google search ... when I come across
> it again I will notify you...
>
>
> Gerritjan Koekkoek
> Vader van Rai Koekkoek (cdls) en voorzitter vereniging CdLS
> Visit our website<http://www.cdlsworld.org>
> Facebook<https://www.facebook.com/gerritjan.koekkoek>
> email<gerrit...@cdlsworld.org>
>
>
>
> 
> From: users <users-boun...@xwiki.org> on behalf of Vincent Massol <
> vinc...@massol.net>
> Sent: 07 October 2016 09:53:03
> To: XWiki Users
> Subject: Re: [xwiki-users] Display macro
>
>
> > On 07 Oct 2016, at 09:48, Gerritjan Koekkoek <gerrit...@cdlsworld.org>
> wrote:
> >
> > When in Velocity generating HTML
> >
> > {{velocity}}
> >
> > {{html}}
> >
> > #foreaech()
> >
> >  #if(display instead of include is required)
> >
> >{{display reference ='page that only works when using display'/}}
> >
> >  #else
> >
> >#includeInContext(page that does not require display)
> >
> >  #end
> >
> > {{/html}}
> >
> > {{/velocity}}
> >
> >
> > What is the velocity macro (or code snippet) to make it work?
> >
> >
> > As documented the {{display}} or {{include}} does not work from within
> the velocity and/or html macro.
>
> They do work. Where did you see that in the doc? Could you give the link
> so that we fix it?
>
> Thanks
> -Vincent
>
>
> > Documentation could maybe be improved by adding what to do when this
> calling from within Velocity/html is required
> >
> >
> > Gerritjan Koekkoek
> > Vader van Rai Koekkoek (cdls) en voorzitter vereniging CdLS
> > Visit our website<http://www.cdlsworld.org>
> > Facebook<https://www.facebook.com/gerritjan.koekkoek>
> > email<gerrit...@cdlsworld.org>
> >
> >
>
> ___
> users mailing list
> users@xwiki.org
> http://lists.xwiki.org/mailman/listinfo/users
> ___
> users mailing list
> users@xwiki.org
> http://lists.xwiki.org/mailman/listinfo/users
>
___
users mailing list
users@xwiki.org
http://lists.xwiki.org/mailman/listinfo/users


Re: [xwiki-users] Display macro

2016-10-07 Thread Gerritjan Koekkoek
Hi Vincent,


I must admit the extension Include-macro en Display-macro documentation does 
not contain any suggestion that it does not work.


I posted my question as I'm very sure I came across this statement that it 
would not work in some doc I found via google search ... when I come across it 
again I will notify you...


Gerritjan Koekkoek
Vader van Rai Koekkoek (cdls) en voorzitter vereniging CdLS
Visit our website<http://www.cdlsworld.org>
Facebook<https://www.facebook.com/gerritjan.koekkoek>
email<gerrit...@cdlsworld.org>




From: users <users-boun...@xwiki.org> on behalf of Vincent Massol 
<vinc...@massol.net>
Sent: 07 October 2016 09:53:03
To: XWiki Users
Subject: Re: [xwiki-users] Display macro


> On 07 Oct 2016, at 09:48, Gerritjan Koekkoek <gerrit...@cdlsworld.org> wrote:
>
> When in Velocity generating HTML
>
> {{velocity}}
>
> {{html}}
>
> #foreaech()
>
>  #if(display instead of include is required)
>
>{{display reference ='page that only works when using display'/}}
>
>  #else
>
>#includeInContext(page that does not require display)
>
>  #end
>
> {{/html}}
>
> {{/velocity}}
>
>
> What is the velocity macro (or code snippet) to make it work?
>
>
> As documented the {{display}} or {{include}} does not work from within the 
> velocity and/or html macro.

They do work. Where did you see that in the doc? Could you give the link so 
that we fix it?

Thanks
-Vincent


> Documentation could maybe be improved by adding what to do when this calling 
> from within Velocity/html is required
>
>
> Gerritjan Koekkoek
> Vader van Rai Koekkoek (cdls) en voorzitter vereniging CdLS
> Visit our website<http://www.cdlsworld.org>
> Facebook<https://www.facebook.com/gerritjan.koekkoek>
> email<gerrit...@cdlsworld.org>
>
>

___
users mailing list
users@xwiki.org
http://lists.xwiki.org/mailman/listinfo/users
___
users mailing list
users@xwiki.org
http://lists.xwiki.org/mailman/listinfo/users


Re: [xwiki-users] Display macro

2016-10-07 Thread Gerritjan Koekkoek
Thanks Thomas,


But the code in the example is just to show the outline...

Believe me: I need HTML around the foreach loop to set enclosing div's and 
jquery and/or bootstrap classes


But your help was great; including the  wiki="true" parameter in the html macro 
makes the display work fine...


Thanks


Gerritjan Koekkoek
Vader van Rai Koekkoek (cdls) en voorzitter vereniging CdLS
Visit our website<http://www.cdlsworld.org>
Facebook<https://www.facebook.com/gerritjan.koekkoek>
email<gerrit...@cdlsworld.org>




From: users <users-boun...@xwiki.org> on behalf of Thomas Mortagne 
<thomas.morta...@xwiki.com>
Sent: 07 October 2016 09:56:40
To: XWiki Users
Subject: Re: [xwiki-users] Display macro

On Fri, Oct 7, 2016 at 9:48 AM, Gerritjan Koekkoek
<gerrit...@cdlsworld.org> wrote:
> When in Velocity generating HTML
>
> {{velocity}}
>
> {{html}}
>
> #foreaech()
>
>   #if(display instead of include is required)
>
> {{display reference ='page that only works when using display'/}}
>
>   #else
>
> #includeInContext(page that does not require display)
>
>   #end
>
> {{/html}}
>
> {{/velocity}}
>
>
> What is the velocity macro (or code snippet) to make it work?
>
>
> As documented the {{display}} or {{include}} does not work from within the 
> velocity and/or html macro. Documentation could maybe be improved by adding 
> what to do when this calling from within Velocity/html is required

Using {{display}} or {{include}} works well in Velocity. But html
macro disable wiki syntax by default and those are wiki syntax (see
http://extensions.xwiki.org/xwiki/bin/view/Extension/HTML+Macro#HParametersdefinition).

That said there is no reason to use html in the example you are giving
(use {{include}} instead of #includeInContex).

>
>
> Gerritjan Koekkoek
> Vader van Rai Koekkoek (cdls) en voorzitter vereniging CdLS
> Visit our website<http://www.cdlsworld.org>
> Facebook<https://www.facebook.com/gerritjan.koekkoek>
> email<gerrit...@cdlsworld.org>
>
>
>
> ___
> users mailing list
> users@xwiki.org
> http://lists.xwiki.org/mailman/listinfo/users



--
Thomas Mortagne
___
users mailing list
users@xwiki.org
http://lists.xwiki.org/mailman/listinfo/users
___
users mailing list
users@xwiki.org
http://lists.xwiki.org/mailman/listinfo/users


Re: [xwiki-users] Display macro

2016-10-07 Thread Vincent Massol

> On 07 Oct 2016, at 09:48, Gerritjan Koekkoek  wrote:
> 
> When in Velocity generating HTML
> 
> {{velocity}}
> 
> {{html}}
> 
> #foreaech()
> 
>  #if(display instead of include is required)
> 
>{{display reference ='page that only works when using display'/}}
> 
>  #else
> 
>#includeInContext(page that does not require display)
> 
>  #end
> 
> {{/html}}
> 
> {{/velocity}}
> 
> 
> What is the velocity macro (or code snippet) to make it work?
> 
> 
> As documented the {{display}} or {{include}} does not work from within the 
> velocity and/or html macro.

They do work. Where did you see that in the doc? Could you give the link so 
that we fix it?

Thanks
-Vincent


> Documentation could maybe be improved by adding what to do when this calling 
> from within Velocity/html is required
> 
> 
> Gerritjan Koekkoek
> Vader van Rai Koekkoek (cdls) en voorzitter vereniging CdLS
> Visit our website
> Facebook
> email
> 
> 

___
users mailing list
users@xwiki.org
http://lists.xwiki.org/mailman/listinfo/users


[xwiki-users] Display macro

2016-10-07 Thread Gerritjan Koekkoek
When in Velocity generating HTML

{{velocity}}

{{html}}

#foreaech()

  #if(display instead of include is required)

{{display reference ='page that only works when using display'/}}

  #else

#includeInContext(page that does not require display)

  #end

{{/html}}

{{/velocity}}


What is the velocity macro (or code snippet) to make it work?


As documented the {{display}} or {{include}} does not work from within the 
velocity and/or html macro. Documentation could maybe be improved by adding 
what to do when this calling from within Velocity/html is required


Gerritjan Koekkoek
Vader van Rai Koekkoek (cdls) en voorzitter vereniging CdLS
Visit our website
Facebook
email



___
users mailing list
users@xwiki.org
http://lists.xwiki.org/mailman/listinfo/users