How can I use a Tumblr photoset with the Twitter gallery card? - tumblr

I'm trying to use Twitter's gallery card to show off a Tumblr photoset. This is the relvant portion of the code, and everything validates just fine with Twitter:
{block:Photoset}
<meta name="twitter:card" content="gallery">
{block:Photos}<meta name="twitter:image" content="{PhotoURL-500}"/>{/block:Photos}
{block:Photos}<meta name="twitter:image0" content="{PhotoURL-500}"/>{/block:Photos}
{block:Photos}<meta name="twitter:image1" content="{PhotoURL-500}"/>{/block:Photos}
{block:Photos}<meta name="twitter:image2" content="{PhotoURL-500}"/>{/block:Photos}
{block:Photos}<meta name="twitter:image3" content="{PhotoURL-500}"/>{/block:Photos}
{block:Caption}<meta name="twitter:title" content="Photo Gallery"/>{/block:Caption}
{/block:Photoset}
However, if you look closely you may see my problem. I can't figure out how to get unique URLs to each image. {PhotoURL-500} always just returns the same image. According to my apparently incorrect reading of the Tumblr docs (http://www.tumblr.com/docs/en/custom_themes#photoset-posts) it seems like {block:Photos} within {block:Photoset} should cycle through.
What am I missing?
Also - yes, I'm aware I've hard coded the content for twitter:Title.

It isn't possible as of right now.
The issue is that {block:Photos} will iterate over each photo and render the markup inside that tag, but you can't manually control that to pinpoint a single photo.
What your code is doing is that for each photo it renders the Twitter markup 4 times; it wouldn't be a problem if Twitter accepted multiple images without requiring them to be explicitly declared like image0, image1, etc like OpenGraph does (what you want is possible with OpenGraph, just put a single meta tag in a Photos block and it'll be rendered for each photo), but looking at how Twitter is being more and more hostile towards developers leaves little hope for a fix on their side.

Related

Addthis button size class stopped working

We have a sharing toolbox that defaults to 32x32 px but we also use the same toolbox code to display at 20x20 px in other parts of our site. The code below (including Drupal tokens) worked fine for a few months but last month it started showing the icons at 32x32 even though it has the class addthis_20x20_style. It also changed the behavior on another system outside Drupal that uses the same toolbox code.
<div addthis:title="[node:title]" addthis:url="[node:url]"
class="addthis_sharing_toolbox addthis_default_style addthis_20x20_style">
</div>
I tried changing addthis_sharing_toolbox to addthis_toolbox per the support page at http://www.addthis.com/academy/customizing-the-addthis-toolbox/, but then the buttons do not display at all. The AddThis support pages are incredibly disorganized and outdated and they seem to have abandoned their user forum. I don't even know where else to ask.
Here's a reply I received from AddThis support. Hopefully this will be of use to others:
JAN 07, 2016 | 03:26PM EST
Hi,
We recently made a change to our code that affected some of our older
buttons.
You will need to use our advanced configuration code in the locations
that you would like our buttons to appear in 20x20.
Replace the current code in these locations with the following:
<div class="addthis_toolbox addthis_default_style addthis_20x20_style">
<a class="addthis_button_preferred_1"></a>
<a class="addthis_button_preferred_2"></a>
<a class="addthis_button_preferred_3"></a>
<a class="addthis_button_preferred_4"></a>
<a class="addthis_button_compact"></a>
</div>
Additional advanced configuration code information can be found here:
http://www.addthis.com/academy/customizing-the-addthis-toolbox/
Please let me know if you need any additional help
Thanks,
Mike
I am having the same problem. It looks like they have removed support for 20x20 sized buttons, as it is no longer listed on the academy support page you provided. It is a shame because it is the only size that has a constant height for facebook, facebook_like, tweet, etc buttons.
The below css styles, while feeling a little hacky, go some distance in repairing the broken functionality:
.addthis_20x20_style .at-icon-wrapper,
.addthis_20x20_style .at-icon {
height:20px !important;
width:20px !important;
}
That didn't fix the size of the google_plusone button. I happen to be using drupal as well - the addthis module - and the below 'customize services' settings worked pretty well.
That's:
Service code: google_plusone
HTML classes: addthis_button_google_plusone
HTML attributes: g:plusone:size="medium"
(Re the addthis service, the phrase "you had one job!" comes to mind...)

I would like to customize tumblr s lightbox

I hope someone can help me with my problem with tumblrs lightbox.
I only have very basic html knowledge and because of that, I thought, it might be a good idea to work with tumblr themes. Everything works fine, but if you click on a picture on my site, tumblrs lightbox shows up and its back button does not bring you back to my main site, instead it shows the picture on another site.
Thats annoying, but I do not know how to change the options of the tumblr lightbox back button?
http://andreasschmitten20062010.tumblr.com/
Is there anyone here, who knows something about tumblr and how to change this?
Also it would be great if you could move through the other pictures from the lightbox.
Thank you very much
Andre
Get rid of the {LinkOpenTag} and {LinkCloseTag} surrounding the image tag.
Eg.
{LinkOpenTag}
<img src="{PhotoURL-500}" alt="{PhotoAlt}"/>
{LinkCloseTag}
becomes
<img src="{PhotoURL-500}" alt="{PhotoAlt}"/>

Tumblr Photoset not working

The theme I've chosen has decided to reduce photosets to the first frame, instead of giving the full photoset. I want a consolidated photoset shown on my page, instead of the first, single. I have no idea how to do this. I've tried looking on here, using this:
{block:Photoset}
{block:Photos}
<img src="{PhotoURL-500}" class="photoset-img" />
{/block:Photos}
{/block:Photoset}
It worked, sort of. All the photos of the set were there, but they were large and connected together. The images in the photoset are now stacked vertically atop one another instead of side by side and are taking up a lot of space.
The theme block / variable below will generate an iframe containing the images, laid out, as they were set on the dashboard.
{block:Photoset}
{Photoset-500}
{/block:Photoset}

Tumblr Photo Caption within Container

I have a blog theme which does not include captions in photo posts. I have been successful with plugging in {block:Caption} {Caption} {/block:Caption} before {/block:Photo}, but the caption seems to be floating on the background and not inside the post box as seen below:
How do I include the caption to be apart of the same box as the date?
Any help is appreciated!
It would be much easier if you posted the relevant code here. I don't know what theme you are using but if you take a look at this site http://www.tumblr.com/docs/en/custom_themes you'll see that dates are rendered by {block:Date} {/block:Date}, {Timestamp}, {DayOfYear} etc. Take a look and see which one suits you theme. When you have found it, simply Ctrl + F in you code and find where in your HTML code the date box is rendered and then put the {block:Caption} {Caption} {/block:Caption} inside.

What do meta-if tags in Tumblr do?

The example Tumblr gives is
<html>
<head>
<!-- DEFAULTS -->
<meta name="if:Show people I follow" content="1"/>
<meta name="if:Reverse pagination" content="0"/>
</head>
<body>
{block:IfNotReversePagination}
Previous Next
{/block:IfNotReversePagination}
{block:IfReversePagination}
Next Previous
{/block:IfReversePagination}
{block:IfShowPeopleIFollow}
<div id="following">...</div>
{/block:IfShowPeopleIFollow}
</body>
</html>
For these meta-if tags, when I change content="1" to content="0" or content="" nothing seems to happen to the appearance of my tumblr.
I don't understand what these meta-if tags do.
According to Tumblr: By including the special meta-if tags in your theme, users can easily toggle options you define. This is useful for showing or hiding different widgets or design elements.
I understood this as you can show/hide different design elements by changing the content value ie. content="0", content="1", content="". But nothing seems to happen to the design if I do this.
I googled this and I can't find any explanation elaborating on what Tumblr says. Can someone please explain?
Tumblr uses meta tags to save preferences of the theme. Meta if will cause that user gets a new checkbox on the Appearance menu. If its checked than the
<div id="following">...</div>
will be shown on your page.
So there should be new div element in the page source and three dots displayed on the page.
What Bojan Dević said is correct. Although, I would like to address the other half of your question, as well. content="1" automatically sets the element to be shown, or as content="0" makes it hidden.