I am currently working on a major update to the Dynamic Content Gallery plugin for WordPress and, in view of the significant changes this update will bring, I thought it would be useful to outline my plans so that those who wish to give some feedback can do so before I commit to anything.
The Dynamic Content Gallery plugin for WordPress has now exceeded 100,000 downloads from the WordPress plugin repository – so I know that the user base is large and, presumably, enjoys using the plugin and finds it useful. Your feedback is, therefore, important to me.
Certainly, the plugin has evolved considerably since its first release in August 2008, when it was still very much based on the Featured Content Gallery written by Jason Schuller. Much has changed since then, especially with the introduction of many user options, more gallery methods, support for Custom Post Types, the development of a jQuery script to deal with the plugin conflicts that plagues the Mootools version, and the introduction of Auto images.
I am still committed to this development – thanks to positive feedback from a core group of enthusiastic users, and those (relatively few, given the size of the user base) generous folk who have supported its development via donations. No, I’m not in this for the money, but “time is money” and development of a free plugin will always have to take second place to paid work that puts food on my table. Donations, however small, really do help – both financially, of course, and very importantly, motivationally. Many thanks to those who have donated. Much appreciated!
Let’s look at the main changes that are coming…
This is the most significant change and the one that may impact existing users the most.
Version 3.0 of the DCG introduced “Auto” image management, which means that the DCG automatically pulls in the first image attachment from relevant Posts/pages. Although this works fine, there are some disadvantages:
- Pulls in the first image attachment, which means that if you prefer to use the second image attachment in the Post you can’t, unless you first delete (and unattach) the first image.
- Sometimes the image attachment can be perfect for the actual Post content, but its dimensions / aspect ratio don’t work so well in the DCG, and there is no way to override the Auto image with your own choice of image.
- The same source image is used for both the DCG Main image and the carousel thumbnail. Generally speaking, this works fine. However, due to issues of aspect ratio, from time to time the cropped image may be pretty meaningless as a thumbnail. Again, there is not currently a way to get around this – other than to take care when selecting images in the first place.
In view of these shortcomings, I am completely reorganising the way the DCG pulls in images.
Image Management options
“Auto” becomes “Featured Images” (see below) and will be the default setting for new installs of the plugin. “Full URL” and “Partial URL” manual methods are retained for backwards compatibility for those existing users who don’t currently use “Auto”, although I would really like users to move away from these manual modes and adopt “Featured Images”.
In order for Featured Images to work, your theme must support WP Post Thumbnails. If it doesn’t, you can easily add this functionality via the theme’s functions.php:
In the event that WP Post Thumbnails are not supported, the existing “manual” methods remain available. There really isn’t any good reason why a user shouldn’t implement WP Post Thumbnail support. Existing “Auto” users whose theme doesn’t support WP Post Thumbnails will have to add this theme support – or use the “manual” methods. Your choice…
The existing “Auto” image management mode is renamed “Featured Images”, which means that the DCG will now pull in the Featured Image set for each relevant Post/page, rather than grab the first image attachment. The advantage is that you will now be able to select the exact image to be used in the DCG using the built-in WP Featured Image functionality.
In order to allow the use of an alternative image to the Featured Image, a manual override field is added to the DCG Metabox.
This will enable you to specify an alternative image in case, for some reason, you really don’t want to use the Featured Image in the DCG. The manual override image URL must be entered in full URL format.
Two checkboxes in the DCG Metabox will allow you to choose whether the manual override affects either the main image or the carousel thumbnail, or both. This can be useful if, for example, you like Featured Image as the main image, but it makes a poor thumbnail, or vice versa.
By default, it will be assumed that the manual override affects both the main image and the carousel thumbnail.
To be truthful, I haven’t worked out all of this override functionality yet – but the above represents my current thinking.
Intelligent Image Resizing
The DCG will use the add_image_size() function so that a correctly sized main image and thumbnail is created whenever an image is uploaded via the Media Uploader. This will have tremendous advantages:
- Image used in the DCG will be the correct size – which has a positive impact on page load and browser render times.
- A correctly sized thumbnail (100px by 75px) will be created for every image for use in the carousel. Much better visually, and performance wise.
How add_image_size() will work
The DCG will add three image sizes:
add_image_size( 'DCG Thumb', 100, 75, true ); add_image_size( 'DCG Main', w, h, true ); add_image_size( 'DCG Main', w, h, false );
The width (w) and height (h) will be generated dynamically, and will be equal to the gallery width and height settings set in the DCG Settings > Gallery CSS tab. The DCG Thumb size will always be fixed at 100px x 75px.
Note that the DCG will create two versions of each main image – a hard cropped version, and a box resized version. My recent article on using the add_image_size() function explains the difference between the two. In some respects this may be unnecessary but, depending on the source image, sometimes hard crop will give a better result than box resize, or vice versa. By default, box resize will be used as this preserves the complete image, even if there is less control over the final dimensions of this image. (Read this article to find out why.)
As the add_image_size() function is configured dynamically, based on the gallery dimensions, in the event that you change the gallery dimensions the new add_image_size() will only take effect for future image uploads. Any existing images on your server will not be at the new dimensions, therefore you will need to regenerate the new image sizes whenever you change the gallery dimensions. The excellent Regenerate Thumbnails plugin is perfect for this and is extremely easy and safe to use.
If all of this sounds a little heavy, it isn’t really. The only time people play with the gallery dimensions is when first implementing the plugin, or when changing themes in the event the existing DCG size is no longer appropriate for the new theme. In any case, whenever the gallery dimensions are changed, you will be warned that your DCG-specific image sizes have changed and that you may need to run the Regenerate Thumbnails plugin. I shall probably build in a fallback so that the Medium size image is used if no correctly sized Featured Image exists.
Frankly, nothing major as far as the day to day use of the plugin is concerned, and all the additional changes will be behind the scenes. Here’s a rundown of the other main changes:
- DCG Settings page is being reworked slightly to improve the UI and quality of configuration information available to the user.
- Rewritten gallery constructor and helper functions. Now leaner, meaner and better than ever! This was actually a big job but has been badly needed for some time. Most content elements (Image, Title, Slide Pane description, Thumbnail, etc) are now abstracted into their own functions, leaving the constructor functions to deal with Post/page selection, ie the Gallery Method, and output of correct XHTML markup for the two scripts (mootools and jQuery).
- DCG Metabox restyled and UI improved.
- Version checks, Post Thumbnail support checks, and other admin-related check functions have been reorganised and streamlined.
Your Feedback required
Like what you have read? Don’t like what you have read? In either case, please either leave a comment below with your feedback. I value your feedback to help me ensure that DCG development will continue to meet users’ needs. Thanks!