Simple Image Gallery is, as the name states, a simple image gallery. I created this as a learning tool to go over some basic functionality of Drupal 7. As stated on the project page, some of the code is redundant but it serves the purpose of showing how it would be done.
This module is similar to Galerie but differs in that it creates a content type that allows users to select and upload an unlimited number of images. It also changes the primary display div to show the selected image, instead of appending new images to the div. It also has a vastly simpler JS script and doesn't rely too heavily on templates and themes.
You can view the sandbox at: http://drupal.org/sandbox/KurtKnudsen/1858534
It is for Drupal 7 and depends on Views.
To clone the repo, use the following command:
git clone http://git.drupal.org/sandbox/KurtKnudsen/1858534.git simple_image_gallery
I look forward to your feedback.
Comments
Comment #1
vineet.osscube commentedHi,
Firstly there is lots of issue regarding line spaces, indentation & comments.
Look at this !
http://ventral.org/pareview/httpgitdrupalorgsandboxkurtknudsen1858534git
Here you can check source code whether it meets drupal coding standards or not, and advise you what to change in your code. You can repeat review after your commits, and can fix those errors.
Also Please add README.TXT file which tell about module's description, configuration, help, etc.
Comment #2
KurtKnudsen commentedOk, will do. I probably don't have my IDE setup properly for the Drupal standards. Thank you very much.
Comment #3
KurtKnudsen commentedOk, I've updated the git repo with the fixes from the pareview.
Thanks.
Comment #4
dasRicardo commentedYou use only a master branch, but for drupal.org you need to make a repository with version like 7.x-1.x, read it here: http://drupal.org/node/1127732
Comment #5
stijn.blomme commentedHi KurtKnudsen
Automated test and modulepage/git
- The automated test still gives some errors about lines that exceed the 80 character limit.
- as stated by das_ricardo, Please change your branch name to 7.x-1.x
Manual review
- as you said in your documentation your module has a lot of redundant code:
- in your install file and on lines 98 and 111 of your .module file you set variables which hold the image style name but as far as I can see this variable is never used in your module
Your overview page (simple_image_gallery) is created both with a view and with a hook_menu call.
Both pages output more or less the same page.
- at line 44 (comments) you have the following url: "http://example.com/?q=examples/simple_image_gallery"
This should be "http://example.com/simple_image_gallery"
- at line 307 you are using a static query
This is not wrong. but it could be a fun exercise to transform this into one of drupal 7's dynamic query's
-> there is some good documentation about the database sytem and dynamic query's at http://drupal.org/developing/api/database
Overall
As you said this module does not provide a new functionality to Drupal. If you want it to be used by new coders as an example I would recommend that you clean up the redundant code as this wil (in my opnion) confuse new coders. You might consider writing a few blog posts in stead of uploading a module. It could be very educational to have a blog post that shows how to get your view into code. And a second blog posts about how to make the same view page without views. (the finished module could be made available as a download in said blog)
If you don't want to write blog posts please create 2 submodules (one for the views way and one to show the custom query way)
Last but not least i would like to say that you did a really nice job for someone who is only been discovering the Drupal universe for a few weeks. And I think it is pretty brave to put your code directely on the internet to be criticized by others!
Comment #6
stijn.blomme commentedComment #7
klausiClosing due to lack of activity. Feel free to reopen if you are still working on this application.
If you reopen this please keep in mind that we are currently quite busy with all the project applications and I can only review projects with a review bonus. Please help me reviewing and I'll take a look at your project right away :-)