Multicolumn (http://drupal.org/node/1181988/) is a text filter for Drupal 7. It transforms input such as

<multicolumn type="ol" cols="3">
one
two
three
four
five
</multicolumn>

Into three lists, side by side:

  1. one
  2. two
  1. three
  2. four
  1. five

The main virtue of this filter is simplicity. Decide how many columns you want, enter one list item per line, and let PHP do the work. It also produces more consistent results than using a single list with the CSS 3 column-count attribute.

The output is themeable. One theme function generates a render element for each column. These render elements are then passed to a second theme function, which arranges them side by side. A custom theme could rewrite only the second of these functions, yet still change the way the individual columns are themed.

The only related project I have found is the Columns filter. This project is listed as "Maintenance status: Minimally maintained; Development status: Maintenance fixes only." I opened an issue, asking if the maintainer was interested in adding my filter to the module. There has been no response in 8 weeks. In 2009, an issue was opened, asking for the functionality of my filter, but it seems that nothing was done. (I will scoot over there next and add a comment to that issue.)

I started this module for my own purposes. See the test page and the real page that will use this module the next time I update it.

My background: I am a web developer by hobby only. I have been learning Drupal for the past couple of years, and this is my first attempt at writing a module that someone else might want to use. I am currently using Drupal for a few web sites that I maintain:

I have committed a few patches to the Bartik theme and the Examples for Developers project.

Comments

benjifisher’s picture

Issue summary: View changes

Reformat the example as a table.

benjifisher’s picture

Status: Active » Needs review

Update the status.

berkas1’s picture

Status: Needs review » Needs work

You should add README.txt file to repository - http://drupal.org/node/7765

benjifisher’s picture

Status: Needs work » Needs review

Done. berkas1, thanks for the pointer.

klausi’s picture

Status: Needs review » Needs work

* Git release branch missing, see http://drupal.org/node/1015226
* Please remove all old CVS $Id$ tags, not needed anymore
* info file: only list files there that contain classes or interfaces
* dependencies: please specify all dependencies for your module in the info file (filter module?)

benjifisher’s picture

Status: Needs work » Needs review

klausi, thanks for the corrections.

1. I removed the CVS $Id$ tags.
2. The .test file defines a class, but I removed the .module file from the files section of multicolumn.info.
3. Are you sure I need to specify a dependency on the core Filter module? According to admin/modules, it is "Required by: Drupal." I think that means that you cannot run Drupal without it, and adding Filter as a dependency would just add noise to admin/modules. FWIW, the filter_example module does not list a dependency on the Filter module.
4. My module implements hook_help(), but the module will function properly even if Help is disabled, so I do not think I have to add Help as a dependency.
5. I added a 7.0-1.x-rc1 tag.

If you think I am wrong on point 3 or 4, I would appreciate a pointer to something in the Drupal docs that will clear the confusion.

klausi’s picture

Status: Needs review » Needs work

Oh sorry, then of course you don't need the filter module as a dependency.

Did you forget to push your changes? I still see the CVS $Id$ tags in the master branch. Also a 7.x-1.x branch would be nice instead of master.

benjifisher’s picture

Status: Needs work » Needs review

@klausi, thanks for your patience.

I thought I had pushed the changes, but I must have forgotten.

The CVS $Id$ tags are now really gone. This time, I checked http://drupal.org/node/1181988/commits to make sure the commit is really there. (It munged my commit message, turning "$Id$" into "$".)

I added the branch 7.x-1.x and the release tag 7.x-1.0-rc1. In addition to the link you gave me, I found http://drupal.org/node/711070#branches-tags to be helpful.

klausi’s picture

Status: Needs review » Reviewed & tested by the community

Review of the 7.x-1.x branch:

  • Lines in README.txt should not exceed 80 characters, see the guidelines for in-project documentation.
  • There should be no space after the opening "(" of an array, see http://drupal.org/node/318#array
    multicolumn.module:28:    $output .= '<p>' . t('You can add the Multicolumn filter to a text format on the <a href="@formats">Text formats page</a>.  Once you have done so, detailed usage information will be available on the <a href="@tips">Filter tips</a> page.', array( '@formats' => url('admin/config/content/formats'), '@tips' => url('filter/tips'))) . '</p>';
    

This automated report was generated with PAReview.sh, your friendly project application review script. Please report any bugs to klausi.

manual review:
"protected $web_user;": instance variables should be lowerCamleCase named, see http://drupal.org/node/608152

Otherwise I would say this is excellent work and well documented. RTBC for me.

benjifisher’s picture

@klausi,

Thank you. I made the three changes you suggested and committed them, referencing this issue.

Then I ran the unit tests and two assertions failed. :-( I realized that I changed the code to output a little less whitespace in the HTML code. I opened the first issue on my issue queue, #1327884: Tests fail because of whitespace changes in code., posted a patch there, and committed it. In the future, if anyone shows an interest in the module, I will wait for someone else to mark my patches RTBC before committing them.

greggles’s picture

Status: Reviewed & tested by the community » Fixed

Thanks for your contribution, benjifisher! Welcome to the community of project contributors on drupal.org.

I've granted you the git vetted user role which will let you promote this to a full project and also create new projects as either sandbox or "full" projects depending on which you feel is best.

Thanks, also, for your patience with the review process. Anyone is welcome to participate in the review process. Please consider reviewing other projects that are pending review. I encourage you to learn more about that process and join the group of reviewers.

As you continue to work on your module, keep in minde: Commit messages - providing history and credit and Release naming conventions.

benjifisher’s picture

Thank you, klausi and greggles!

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

Anonymous’s picture

Issue summary: View changes

Rearrange the list at the bottom. Fix a mis-matched tag.