Closed (fixed)
Project:
Twitter Block
Version:
7.x-1.x-dev
Component:
Code
Priority:
Normal
Category:
Task
Assigned:
Reporter:
Created:
17 Aug 2012 at 01:09 UTC
Updated:
1 Sep 2012 at 19:21 UTC
Jump to comment: Most recent file
Twitter Block currently uses the HTML returned by the twitter_block_load_tweets() function as block content. This causes a few issues:
twitter_block.css file in the module's .info file. This unnecessarily includes the CSS on every page which negatively affects performance. Attaching the CSS to the block's content inside of a render array will only load the CSS when the block is displayed.twitter_block theme function is primarily provided for users to customize the wrapper around the tweets. By integration this into the render array, the theme function can be removed which would improve performance.| Comment | File | Size | Author |
|---|---|---|---|
| #3 | convert-block-content-to-render-array-1735244-3.patch | 4.59 KB | devin carlson |
| #1 | convert-block-content-to-render-array-1735244-1.patch | 5.23 KB | devin carlson |
Comments
Comment #1
devin carlson commentedAttached is a patch to convert the block content to a render array.
Comment #2
ZenDoodles commentedThis looks great. Functionally it's good. I have a couple of tiny comments, but none of them really deal breakers, so I'm also marking rtbc. You can do the honors if you like.
Let's leave the twitter_block in here too in case someone has already used it in a theme? Also, isn't the clearfix part of another patch somewhere?
Trailing white-space
I think maybe this comment is not accurate anymore?
The style guide says to break it up if it extends past 80 chars. I know it's nit-picky, but IMO in this case the original is easier to read. Not a deal breaker tho. If it's important to you leave it.
Comment #3
devin carlson commentedRerolled to address the concerns outlined in #2.
twitter_blockclass out of the render array and back into the template file and kept the CSS file in the same location.Comment #4
devin carlson commentedCommitted to 7.x-1.x.