Create Plugin/Widget for Hero Image Space on Commons Homepage
Please see discussion on Basecamp.
#2 Updated by Boone Gorges about 11 years ago
I've installed Ron's plugin on the wp-3.0-upgrade branch with https://github.com/castiron/cac/commit/7003dbe818f601a1a8ab83f12e7db0bca30f4b36. Still needs some styling and bugfixing to make it work with our theme.
#3 Updated by Boone Gorges almost 11 years ago
- Status changed from Assigned to Resolved
I've made the changes necessary to make the widget look right on the front page.
For some reason there were some weird styling conflicts between Ron's release version and the Commons style. I stared at the CSS and markup for a long time, guessing at a lot of stuff, before I finally got it to look right. It needs cross-browser checks, and I encourage you not to look at the code, as it is messy and sucky. But as of now it looks right, at least.
Ron, I was having problems with the way that the plugin was feeding inline height/width attributes on the images. I changed line 114 to
<?php echo apply_filters( 'pgw_image_markup', $p->tag ); ?>
Then I put a filter in our theme's functions.php that grabs the height/width attributes in the markup and changes them to the correct values. Again, this is probably a stupid way to do it, but for the life of me I couldn't get it to work with CSS, and a stupid working method is better than a proper non-working one :)
There is also a slight issue with the way that the widget loads. It seems as if there's a hiccup before it loads the plugin's stylesheet. You can see it at http://cdev.gc.cuny.edu. This seems like an issue beyond Ron's plugin, so I'll open a separate ticket for it.
A note to myself and anyone else who manages the Gallery Posts data type. Don't put images directly into the post, as they'll show up double. Just upload them from the post edit screen, so that they're associated with the plugin. Also, when launching on the real site, choose "Large" as the image size on the widget.