Hello.

We have such situation. There is CCK field url in our news nodes. And we want make post this info to twitter by another way.

For example we want put tihs url field into twitter post instead of url of node.
But there is not possible make some themization around twitter post body. In our case it's not good i have write own patch to module

Comments

Stan.Ezersky’s picture

+1

michaek’s picture

Status: Active » Closed (duplicate)

I don't think theming would be the right approach to customize Twitter messages - it's more appropriate to use tokens: see #871728: twitter_actions token support missing

ilya1st’s picture

Status: Closed (duplicate) » Active

In our case we must to substitute URL placed in to CCK field of node.

I think here must present both token and theming possibilities.
(in my advimage module I did so for formats templates for some custom cases)

Aleksey Zubko’s picture

subscribe

michaek’s picture

The use case you're describing, including a CCK field value in the message, would be very straightforward with a Token implementation, and I can't think of a reason that the theme layer should be involved.

Can you describe why the theme layer would be the appropriate place to change the content of a Twitter message?

I'll leave this active for now, but absent any compelling reason, I'm pretty sure providing theme hooks is not the direction the module will go. On the other hand, Token support will be restored to the module as soon as I test the patch in #871728: twitter_actions token support missing.

ilya1st’s picture

AFAIK token does not allow such things.

E.g. in out project we have node type "news" with CCK field URL.

After editor changes something on site(e.g. he've changed some chapter or updated article) he write news node with url to node which has beed changed. Ater that we need twitter post with this news node text and short url from it's cck key. So there must be additional function to allow manual theming both with tokens theming.

My idea is default theme function with defines default behaviour

functon theme_twitter_repost_text($node) {
  return twitter_repost_test_standard_text($node);
}

Wherte twitter_repost_test_standard_text does standard operations with tokens.
Doing such way we give some freedom to programmer - use tokens there or theme content manually.

Or we need additional hook there.

In my advimage module, it's advimage_ref extension I did so for filter formatting output. I think, sometimes token replacements are not enough.

michaek’s picture

It seems to me that when you say "theming", you mean "customizing" more broadly, which could lead to some confusion.

Part of my concern here is philosophical. Because posting a Twitter message is part of the function of the site, the theme layer shouldn't be involved, as its responsibility is the _display_ of the site. A module hook for rewriting Twitter messages may be useful, but I can't see any reason to support a theme hook.

When this patch is adopted, Twitter messages will be able to accept placeholders for all tokens, which will include CCK fields. What you seem to be looking for is a way to specify different default message strings for different node types. That seems both simpler and more likely to address more common use cases.

ilya1st’s picture

Status: Active » Closed (duplicate)

Twitter messages will be able to accept placeholders for all tokens, which will include CCK fields.

if token can do this(I have no knowledge about token module internals yet) - I have no questions anymore. Thanks.

michaek’s picture

Thanks for the update. I'll do my best to get the token patch applied soon, but it seems like it might still be a good idea to have customizable Twitter messages per content type in the future.

Dxxxs’s picture

+1

glu2006’s picture

+1 subscrybe

michaek’s picture

Hi, folks. This is a closed issue, so it's probably not much good to subscribe to it. :)