clickrain / EE_Twitter

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

Use native Twitter variables #30

Closed klibansky closed 10 years ago

klibansky commented 11 years ago

May I ask, Why can't we just use the native twitter variables? Like the way the Facebook Link module works (by hicksondesign.com/facebook_link). A template example is:

{exp:fb_link:graph graph="your_page?fields=feed"} {feed} {feed:data} {if feed:type == 'photo'}

{feed:message}

Posted by {feed:from}{from:name}{/feed:from} on {feed:created_time format="%D, %M %d"}.

{/if} {/feed:data} {/feed} {/exp:fb_link:graph}

This is way more flexible.

In my twitter feed on my website I would like to always display an image before the tweet. By default this would we the profile picture. If the tweet contains images, I would like to take the first image and use that as 'tweet image'.

At the moment I have this (that does not work): {images} {if image} {exp:ce_img:single src="{image}" width="64" height="64" crop="yes|center,center" alt="Shop" quality="95" class="media-object"} {if:else} {exp:ce_img:single src="/images/shop/products/4.jpg" width="64" height="64" crop="yes|center,center" alt="Shop" quality="95" class="media-object"} {/if} {/images}

I also tried:

{if images} {images} {exp:ce_img:single src="{image}" width="64" height="64" crop="yes|center,center" alt="Shop" quality="95" class="media-object"} {/images} {if:else} {exp:ce_img:single src="/images/shop/products/4.jpg" width="64" height="64" crop="yes|center,center" alt="Shop" quality="95" class="media-object"} {/if}

I have also tried the rest module (https://github.com/philsturgeon/ee2-rest) however there is no way to autenticate :(

klibansky commented 11 years ago

I just got it to work like this: {if "{images}{image}{/images}" != ""} {images} {exp:ce_img:single src="{image}" width="64" height="64" crop="yes|center,center" alt="Shop" quality="95" allow_scale_larger="yes" class="media-object"} {/images} {if:else} {exp:ce_img:single src="{profile_image_url}" width="64" height="64" crop="yes|center,center" alt="Shop" quality="95" allow_scale_larger="yes" class="media-object"} {/if}

bryanburgers commented 10 years ago

Following up.

  1. I'm glad you figured it out.
  2. As far as using native Twitter variables, I don't know exactly what you mean. Could you expand?