The Move Region module allows you to move the content of a region in its entirety into another region on specified pages. This is especially useful for pages that need to have a different region layout, for example having the sidebar on the opposite side of the main content.
It is possible to achieve this with the Context module, but this was not applicable in my use case. My client needed a very simple module that allows to move the sidebars to the other side of the screen on certain pages and rejected Context because of its perceived complexity. Context is more of a site builder tool, while Move Region is an end user tool.
Sandbox: http://drupal.org/sandbox/pfrenssen/1411168
Repo: git clone --branch 7.x-1.x http://git.drupal.org/sandbox/pfrenssen/1411168.git move_region
Module is for Drupal 7.
Comments
Comment #1
drupaledmonk commentedPlease do a PAreview, it is showing one error.
http://ventral.org/pareview
Comment #2
pfrenssenHey, thanks for the speedy review!
I have already run the module through this awesome service and have fixed all errors except one before submitting the project application. It now only generates this error about the following doc block:
In this case the script is confused because the default variables
$formand$form_stateare not documented. IMO this is a shortcoming of the automatic review script. I see this documentation pattern all over core. Here is an example out of block.admin.inc which has also omitted the documentation of$formand$form_statefor a form builder:I am willing to change this however if it is essential that the automated review passes with no errors. I could simply remove the offending line from the doc block. This would make the module marginally less documented but would satisfy the review script.
Comment #3
operinko commentedTested the functionality, works as intended.
As for issues:
I'm going to skip the doxygen issue, since it's been used that way in core as well.
But, there is one other minor issue that's easy enough to fix:
$output .= '<dd>' . t('With the Move Region module you can create multiple configurations in which you can decide which regions should be moved, where they should be moved to, and on which pages this should occur.' . '</dd>');Just move the
. '</dd>'outside the t() and you're good to go.Comment #4
pfrenssenThanks a lot for the review! Nice catch, I have fixed it and attributed the patch to you.
Comment #5
bulldozer2003Very simple but pretty cool module.
You need to complete your
tag on your last line of $output in move_region_help().
You could extend the array at the end of line 75 in move_region.admin.inc to multiple lines.
Don't worry I won't forget ya for a month.
Comment #6
pfrenssenThanks a lot Brian!
I have fixed the missing closing tag. I do respectfully disagree about splitting the long instance of t() on line 75 of move_region.admin.inc. I have just spent some time looking at core to see how calls to t() are handled inside render arrays, and it is consistently put on one single line.
Here's an example that looks quite similar, from system_clean_url_settings():
Comment #7
scot.hubbard commentedAutomated review is clean with the exception of the line 75 error, which I agree is nothing to worry about.
Looking at the code I can find no issues, however, on testing the module with a clean drupal 7 install I did find one issue.
My first test was to try and swap the header into the footer region but nothing happened. I then tryied to swap the first sidebar into the second sidebar and this worked. Not sure if I have missed something or not.
I will leave as "needs review" in case anyone else finds the same issue. Good module though.
Comment #8
soncco commentedVery useful module!!!
@scot.hubbard works fine for me in all cases.
Comment #9
pfrenssen@scot.hubbard: I can't replicate this problem, can you give some more information? Perhaps the content of your header is hard coded in a template file?
@soncco: thanks for the RTBC! :)
Comment #10
scot.hubbard commentedHi pfrenssen,
It was a clean install of drupal 7 using the default theme. No theming work had been done at all.
Perhaps just a freak occurrence?!
Comment #11
bulldozer2003@scot.hubbard I had no problems moving regions, but I did notice that regions were listed that bartik did not seem to be using. I ended up referencing my blocks/regions page to choose to that were being used and everything worked as it should.
Comment #12
pfrenssenIndeed, when you have multiple themes installed it can be difficult to pick the right regions, especially since the region names of different themes are often very similarly named. After enabling 5 contrib base themes it became practically impossible to choose the regions. This probably also caused the problem from #7, since it is possible to select regions from two different themes.
I've updated the module and the regions are now separated out by theme. Much better :) If you would like to try it, please reinstall the module because the database schema has changed.
Comment #13
bulldozer2003I'll try to take a look soon. Anyone else reading this, please feel free to comment a review.
Comment #14
patrickd commentedRegarding the workflow, are you sure you want to switch back to needs review?
Comment #15
pfrenssenGood point, I was assuming that newly introduced code == a new review, but having read the workflow I think this is not really the way forward.
Setting back to RTBC as per #8.
Comment #16
patrickd commentedComment #17
patrickd commentedYour project page is short and not very informative, please have a look at the tips for a great project page.
Beside this your module looks good!
Thanks for your contribution and 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 mind: Commit messages - providing history and credit and Release naming conventions.
Thanks to the dedicated reviewer(s) as well.
Comment #18
pfrenssenGreat news, thanks a lot everybody!
Comment #19.0
(not verified) commentedReplaced git repo with the public one.