Uploaded image for project: 'XWiki Platform'
  1. XWiki Platform
  2. XWIKI-10118

Container macro cannot be added more than once with different number of columns

    XMLWordPrintable

    Details

    • Tests:
      Unit
    • Difficulty:
      Medium
    • Documentation:
      N/A
    • Documentation in Release Notes:
      N/A
    • Pull Request Status:
      Pull Request accepted
    • Similar issues:

      Description

      It seems a limitation of container macro, is that it injects columns.css in the page with number of columns as parameter.
      So if you add more than one container to the same page, they can't have a different number of columns ...

      This can be easily seen, if you had the following into a page:

      {{container layoutStyle="columns"}}
      ((( a )))
      ((( b )))
      ((( c )))
      {{/container}}
      

      You see 3 columns displayed as expected:

      a  b  c
      

      But if you add another container :

      {{container layoutStyle="columns"}}
      ((( a )))
      ((( b )))
      ((( c )))
      {{/container}}
      {{container layoutStyle="columns"}}
      ((( d )))
      ((( e )))
      {{/container}}
      

      Then you see every container is aligned in 2 columns:

      a b
      c
      d e
      

      As far as I understand, this is due to the fact that in ColumnsLayoutManager.java, columns.css gets injected with number of columns as parameter (in order to compute column width), and obviously this can only be done one time for a page...

        Attachments

          Activity

            People

            Assignee:
            DarkKnightCZ Lukas Raska
            Reporter:
            jbousque Jeremie BOUSQUET
            Votes:
            1 Vote for this issue
            Watchers:
            7 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved:
              Date of First Response: