[xwiki-devs] [Proposal] Modify Box Macro

Vincent Massol vincent at massol.net
Mon Mar 28 13:28:28 UTC 2011


On Mar 28, 2011, at 3:20 PM, Andreas Hahn wrote:

> Am 28.03.2011 14:14, schrieb Vincent Massol:
>> IMO we should also deprecate the "cssClass" and "width" box macro parameters.
>> 
>> If the user wants to use a different class or width he can use:
>> 
>> (% class="..." style="width:..." %){{box/}}
>> 
>> or for standalone (before we add a shortcut in the parser, see http://jira.xwiki.org/jira/browse/XRENDERING-75):
>> 
>> (% class="..." style="width:..." %)(((
>> {{box/}}
>> )))
>> 
>> Thanks
>> -Vincent
>> 
> Hi,
> 
> my experience is that many macros behave different, when you apply a style:
> (% class="..." style="width:..." %)  {{somemacro/}}
> As far as i remember its not always enclosed in a <div></div>

Not exactly.

Block parameters for standalone macro is not supported right now, you need to write:

(% .... %)(((
{{macro/}}
)))

If you write 

(% ... %){{macro/}}

then you're creating an inline macro.

> It would be nice if all *rendering* macros behave in the same consistent 
> manner.

They do.

> Wouldn't it be a better solution if all rendering macros support (at 
> least) a basic set of common parameters ?
> e.g. 4 html core attributes (class, id, style, title):
> http://www.w3schools.com/tags/ref_standardattributes.asp
> Macro implementation should apply those parameters always to the first 
> html markup generated.
> This would imo make it easier to apply custom styling in a consistent way.
> 
> btw, Its often a surprise to me how (% ... %) renders.
> You can highlight one individual header:
> (% class="highlight" %)
> = my highlighted header
> 
> but you can't highlight an item in a list of items the same way:
> * item
> * item
> (% class="highlight" %)
> * not highlighted - sigh :(

See  http://jira.xwiki.org/jira/browse/XRENDERING-36

Thanks
-Vincent

> 
> bye
> Andreas




More information about the devs mailing list