This module provides you with the option to add a thumbnail preview to your content types.
Updated to full project
http://drupal.org/project/content_type_thumbnail
Drupal version: 7
Required modules: image, node
Sandbox project: http://drupal.org/sandbox/mikespence/1934058
Git repository: git clone --recursive --branch 7.x-1.x http://git.drupal.org/sandbox/mikespence/1934058.git content_type_thumbnail
This module provides you with the option to add a thumbnail preview to your content types.
Why you need it?
This module is useful for visually displaying the difference between content types. I often find that the description text is not always that helpful.
How to use it?
- Install and enable the module
- Go to your Content Types, under the admin/structure page
- Click edit on the content type you want to add an image for
- Under "Thumbnail" you'll find an image field, upload your image
- Go to Add Content, you'll see your new thumbnail next to your content type
Settings
- All thumbnails use the Image Style 'content_type_thumbnail', you can change
the settings of this style to suit your needs here:
admin/config/media/image-styles - There are two layouts options for the node add screen. Either grid or list.
You can change this setting here:
admin/config/content/content_type_thumbnail
Note: Make sure your files directory has the correct permissions
PAReview Output:
http://ventral.org/pareview/httpgitdrupalorgsandboxmikespence1934058git
Reviews of Other Projects
Round 1
http://drupal.org/node/1856530#comment-7144746
http://drupal.org/node/1905876#comment-7146546
http://drupal.org/node/1935118#comment-7146608
Round 2
http://drupal.org/node/1912532#comment-7146644
http://drupal.org/node/1937044#comment-7151194
http://drupal.org/node/1936848#comment-7151204
| Comment | File | Size | Author |
|---|---|---|---|
| Screen Shot 2013-03-05 at 14.35.41.png | 72.25 KB | mikespence | |
| Screen Shot 2013-03-05 at 14.34.58.png | 124.9 KB | mikespence | |
| Screen Shot 2013-03-05 at 14.30.27.png | 75.16 KB | mikespence |
Comments
Comment #0.0
mikespence commentedReminder to set up the correct permissions on the files directory
Comment #1
davidsonjames commentedHello, please try to fix issues raised by automated review tools:
http://ventral.org/pareview/httpgitdrupalorgsandboxmikespence1934058git
Currently you only have a master branch, please branch to 7.x-1.x and delete the master branch.
Thanks.
Comment #2
mishradileep commentedYou are working on "Master" branch. You should be working on "7.x-1.x" branch.
Firstly correct the code reviewed by http://ventral.org auto review script. You may find review result of your project from below URL:
http://ventral.org/pareview/httpgitdrupalorgsandboxmikespence1934058git
Comment #2.0
mikespence commentedUpdated issue summary.
Comment #3
mikespence commentedHave fixed issues raised by the review (http://ventral.org/pareview/httpgitdrupalorgsandboxmikespence1934058git).
Thanks.
Comment #4
mikespence commentedComment #4.0
mikespence commentedUpdated issue summary.
Comment #4.1
mikespence commentedUpdated issue summary.
Comment #5
mikespence commentedComment #6
bkonetzny commentedNice idea for a module!
Here is my feedback:
Comment #7
mikespence commentedThanks for your feedback! Much appreciated.
Changes made:
Thanks again!
Comment #8
bkonetzny commentedDon't get me wrong, using an image_style was a very good idea, as this image_style was configurable by the user and could include more effects than just resizing. Just the 160x160 was not correct, as the style could be changed. Why did you remove it?
The code in content_type_thumbnail_form_node_type_form_alter():
Should be changed to:
Additionally, content_type_thumbnail_add_node() now includes inline styles, which prevent styling via themes.
Comment #9
mikespence commentedI see what you mean, whoops!
I'll get that back in there then. I see what you were saying now :-)
Thanks, I'll have a look at those changes
Comment #9.0
mikespence commentedPAReview Link added
Comment #10
mikespence commentedImage style is back. README text file is updated. I've also removed all the inline styling.
Ready for review again. Thanks.
Comment #10.0
mikespence commentedAdd node to required modules
Comment #10.1
mikespence commentedUpdated issue summary.
Comment #10.2
mikespence commentedUpdated issue summary.
Comment #11
mikespence commentedComment #11.0
mikespence commentedAdd new Reviews of Other Projects
Comment #11.1
mikespence commentedUpdate reviews of other projects
Comment #11.2
mikespence commentedReviewed other projects
Comment #12
mikespence commentedNew reviews of other 'needs review' projects.
Comment #13
amorsent commentedNice module idea. Overall the code looks pretty good to me.
Here's my feedback:
So I kind of take issue with overriding the node/add page callback. There's a few issues here:
I would approach this problem by overriding the theme_node_add_list() theme function instead of the full menu router item. The normal node_add_page() function calls this to theme the output from system_admin_menu_block().
But let me just step backwards for a moment. I would start by wrapping the content_type_thumbnail image logic itself in a theme function. That gets it isolated out of the rest of the display logic. This lets you easily reuse it, and makes it possible for other themes or modules to override it if necessary. That would look something like this (untested) :
Now we can generate the image anytime we want like so:
Ok, so back to overriding theme_node_add_list(). Basically theme_node_add_list() gets a list of menu items to theme. Since these are not nodetypes, you have to derive the nodetype from the path, but that's easy enough. I think the override could look something like this:
Note that this markup is a bit different from yours. This is mainly because I didn't feel taking the time to match it. I think this illustrates the main concept. However, I do also think it's best for modules to keep their markup as similar to core as possible so that other modules and themes know what to expect. Themes can then make whatever radical overrides they want - this is one reason to make all markup come from a theme function, not directly from a page callback.
Anyway, It looks like a pretty cool module :) I hope this is helpful. I think most of this is just nit-picking on implementation details, however exposing a full list of node_types without access checks is a potential security issue i think.
Comment #14
mikespence commentedWow! Amazingly helpful. Thanks.
Comment #15
mikespence commentedThanks for your helpful feedback. I've actioned those changes. Didn't think about the security implication. Thanks again!
The theming info was extremely helpful. Big thanks to @amorsent
Comment #15.0
mikespence commentedMore reviews done
Comment #15.1
adbo commentedUpdate how to use it
Comment #16
adbo commentedJust a heads up, looks like your git link above should be
git clone --recursive --branch 7.x-1.x http://git.drupal.org/sandbox/mikespence/1934058.git content_type_thumbnailso that it doesn't ask people for your mikespence@git.drupal.org password when trying to clone.
edit: forgot a word
Comment #17
mikespence commentedGood spot. That was right, I must have changed it accidentally when updating the info! Cheers.
Comment #18
mikespence commentedWould love some more reviews or to have it accepted?
Comment #19
jongagne commentedHi Mike,
nice simple module. Here is my feedback:
Other than that, module works like a charm.
Good luck.
Comment #20
mikespence commentedThanks for the feedback! There was and now is again an image style included in the module file.
Think it's all ready to go :-)
Comment #20.0
mikespence commentedrookie mistake on the code for git
Comment #20.1
mikespence commentedNew project reviews
Comment #21
mikespence commentedReviewed 3 more projects (links above)
Comment #22
klausimanual review:
But otherwise looks RTBC to me.
Assigning to mitchell as he might have time to take a final look at this.
Comment #23
mikespence commentedThanks! I'll have a look at updating those tonight :-)
Comment #24
mitchell commentedCool module. Thanks for contributing it, mikespence!
I updated your account to let you promote this to a full project and also create new projects as either a sandbox or a "full" project.
Here are some recommended readings to help with excellent maintainership:
You can find lots more contributors chatting on IRC in #drupal-contribute. So, come hang out and get involved!
Thanks, also, for your patience with the review process. Thanks to the dedicated reviewer(s) as well.
Comment #25
mikespence commentedThanks all :-)
Comment #25.0
mikespence commentedUpdated issue summary.
Comment #26.0
(not verified) commentedURL