| Project: | Columns filter |
| Version: | 7.x-1.x-dev |
| Component: | Code |
| Category: | feature request |
| Priority: | normal |
| Assigned: | Unassigned |
| Status: | needs review |
Issue Summary
Is it possible to create a piece of content that utilizes the column filter, for say... half the document with the rest of the text going below the content in columns in a single paragraph? The Drupal site I work with has multiple content editors and I'm picturing a future where someone tries to do this and ends up with 5 columns because they keep clicking the column button or something...
I'm not really a coder (I don't think a beginning Comp Sci course in ADA counts), so I wouldn't even know where to begin or what to do if this isn't already a feature of this module. I'm willing to try, however, to better myself and better the module. Anyway...
What if it were something like, for example:
<!--start column-->
Content in 1st column
[..]
Content in 2nd column
[etc]
<!--stop column-->
Content not in a columnWould this be feasible/easy to implement?
Thanks!
Comments
#1
It's not that hard to do.
We could have a tag like "<!--column-end-->" which puts content after that into a regular DIV -- a full-width node footer in other words.
Thing is, if we do this, then we should allow full-width header too.
And then, what if you want a header, then 2 columns, then full-width, then 3 columns, then a footer?
So I'd do this with a "<!--section-->" which defines a section break.
If there's only one chuck of text there then it's a single column, if it has at least one column tag then it splits into columns.
This does mean one new fake tags which adds to complexity, and on top of that we have to support wysiwyg too.
I'm not convinced this is a good thing -- it's maybe adding too much complexity to a simple module, and your use case is perhaps something where you should just switch over to full HTML.
Will ponder :)
#2
Attached is patch which implements <!--section--> break to support multiple column layouts in a single text field, e.g.
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Integer cursus iaculis volutpat. Aenean vulputate est id leo lobortis congue? Nulla mauris lorem, volutpat sed semper at, consequat sed nisl. Integer lectus ligula, bibendum sit amet placerat id, adipiscing eu metus?
<!--section-->
Praesent felis nisl, sollicitudin eget facilisis non, iaculis nec elit. Aenean scelerisque diam sed erat faucibus ultrices. Ut risus dui, pulvinar in venenatis quis, consectetur vel ante. Nam sagittis urna eget magna bibendum vitae viverra mauris rhoncus. Aenean non tellus risus.
<!--column-->
Donec viverra volutpat elit eget viverra? Nulla facilisi. Pellentesque faucibus, justo vitae porta ullamcorper, neque magna congue sem, et sollicitudin risus arcu et nunc. In erat lacus, adipiscing et pulvinar quis, hendrerit et eros. Mauris vestibulum varius dui a posuere.
<!--section-->
Sed ullamcorper scelerisque ante sed tempus? Morbi consequat, nisl faucibus interdum dignissim, justo nunc viverra dui, eget auctor erat quam sit amet magna. Duis porta vulputate ipsum vitae accumsan. Fusce scelerisque bibendum turpis id malesuada.
which would produce...
I have not tested with wysiwyg editors... YMMV.
#3
#4
John, this works nicely! Thank you!!
However, if the two columns are not of the same size some content from the rest of the posts are picked up and placed into the column section in the node. How can I prevent that?
For example, in this node: http://www.sachalayatan.com/mahbub/37199 The post uses a section break at the end. Note how the title got placed at the top of column 2 and part of the text got placed into the column. I think I need to fix my CSS.
#5
Subscribe. We'll need to port this to D7.
#6
Patch needs a few modifications:
#7
Here is a binary patch that adds all the above.