I love this module!

What I would really like is if I could customize the default message when someone uses twitter. So that it says something like:

Check out the video (node) at (url) by @ModsUnraveled!

Instead of the current "(node) | (site) (url) via @AddToAny"

Is there any chance of this being added, so that I don't have to muck around in code?

Comments

micropat’s picture

Category: feature » support
Status: Active » Closed (works as designed)

Thanks! :)

Actually you can already customize the Twitter message by pasting the following code into the Additional Options box (at the bottom of the config page: admin/config/system/addtoany).

a2a_config.templates = {
    twitter: "Reading: ${title} ${link} by @ModsUnraveled"
};

It's a little bit of code mucking, but no so bad. :)

bjlewis2’s picture

Excellent! Thanks so much!

scotwith1t’s picture

Version: 7.x-3.x-dev » 6.x-3.4
Issue summary: View changes
Status: Closed (works as designed) » Needs work

Sorry to reopen, but this doesn't seem to work in v. 6.x-3.4. I've added the above code (with our Twitter ID of course) to that area and it doesn't do anything...
Only local images are allowed.

scotwith1t’s picture

here's the code i've got in the Additional options box:

a2a_config.templates = {
    twitter: "${title} | from @wwwCISorg" ${link}
};
erikphanson’s picture

Some per content type customization would really be awesome. Is this possible now in code?

micropat’s picture

@scotself You had an error in your JavaScript syntax. This is what you want:

a2a_config.templates = {
    twitter: "${title} | from @wwwCISorg ${link}"
};


@erikphanson AddToAny JavaScript events would be your best workaround for that right now. See the "Modifying the share" section, then for example: if (share_data.service = 'twitter') { /* Change share_data.title if also a specific content type */ }

micropat’s picture

Status: Needs work » Closed (fixed)