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 column

Would this be feasible/easy to implement?

Thanks!

Comments

joachim’s picture

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 :)

john.money’s picture

Title: Stop the Column Filter? » Multiple column layouts in single text field
StatusFileSize
new2.06 KB

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...

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?
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. 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.
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.

I have not tested with wysiwyg editors... YMMV.

john.money’s picture

Status: Active » Needs review
udvranto’s picture

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.

dboulet’s picture

Subscribe. We'll need to port this to D7.

dboulet’s picture

Status: Needs review » Needs work

Patch needs a few modifications:

  • If we're going to use constants, they'll have to be named using Drupal coding standards: "Module-defined constant names should also be prefixed by an uppercase spelling of the module they are defined by."
  • The PHPdocs will have to be changed to reflect the additions to the code.
  • A WYSIWYG button for the section breaks will have to be added.
dboulet’s picture

Version: 6.x-1.2 » 7.x-1.x-dev
Status: Needs work » Needs review
StatusFileSize
new12.97 KB

Here is a binary patch that adds all the above.

phily’s picture

For whom may be interested, here is the full 7.x-1.x-dev release as of 2013-Sep-30 patched with comment #7 (thanks to dboulet).

Works fine with Drupal 7.37 core, WYSIWYG 7.x-2.x-dev module (dev is required for latest CKEditor handling) and CKEditor 4.4.7 used as a library.
Be aware that you might need to edit columns_filter.css to fit your website theme.

bgilhome’s picture

StatusFileSize
new11.78 KB
new9.23 KB

I've updated the 7.x-1.x patch with a few changes:

  • added a div.columns-filter-section around the themed columns to allow easier styling
  • updated columns_filter.css to use table-cell styling (allowing for vertical-align)
  • added 'js path', 'js file', 'css path' and 'css file' to $plugins['sectionbreak'] in hook_INCLUDE_plugin() so that it uses the columnbreak files instead of looking for sectionbreak.js/css by default

Updated patch and interdiff from section_break-564720-7.patch attached.