clickrain / EE_Twitter

EE Add-on that uses oAuth to display Twitter Feed
Other
48 stars 18 forks source link

Limit Images #29

Closed klibansky closed 10 years ago

klibansky commented 11 years ago

I would like to display one thumbnail for every tweet. If the tweet contains images, I would like to display one of those images (the first one) as the thumbnail. If the tweet doesn't contain any images, I would like to display the profile picture. The only thing I need now is to be able to limit the images outputted like so: {images limit="1"} ... {/images} Could this be added? Or can it be done already?

bryanburgers commented 11 years ago

@maarten00 originally added the images code. I wonder if he has any insight on this.

maarten00 commented 11 years ago

This could possibly be done with the {count} and {total_results} variables within the {images} tags. I haven't had to use them yet though, so I'm not sure if it would work. I would imagine that the count variable could conflict with the one from the twitter:user tag, so maybe it would be necessairy to add a prefix like you can with Playa and var_prefix. I believe var_prefix is not default EE behaviour however. Possibly we need to add support for the count and total results variables within the {images} tag.

Could you report back if those work for you?

maarten00 commented 11 years ago

I have added support for the images prefix in a seperate branch of my own fork of EE Twitter; https://github.com/maarten00/EE_Twitter/tree/images_prefix

I have not yet tested it myself as I do not have access to an EE installation at the moment, but you are free to try it out. If it works I will do a pull request and Bryan can add it to a future release of EE_Twitter! :)