I would like the option to be able to post to my fan page wall rather than my personal wall.
I think the best way would be to add a field to the content type settings where you can add the Facebook Page ID
If done that using
$form['fbconnect_settings']['onoff'] = array(
'#type' => 'checkbox',
'#title' => t('Allow this content type to publish to facebook'),
'#default_value' => variable_get('fbconnect_' . $form['#node_type']->type . '_onoff', 0),
);
$form['fbconnect_settings']['pageid'] = array(
'#type' => 'textfield',
'#title' => t('Enter Facebook Page ID'),
'#default_value' => variable_get('fbconnect_' . $form['#node_type']->type . '_pageid', 0),
);
so I can save the page id
I been a bit stuck now as what to do next.
Comments
Comment #1
vivianspencer commentedDid you make any progress on this? I'd like to see how you achieved this
Comment #2
marcus178 commentedI've not really looked at any more, not really sure what to do to get it to post to the fan page wall.
Comment #3
vivianspencer commentedI've got it working, thought I'd post it here so you can try it yourself:
1. I created a module with the following code:
2. I added the followin to my template.php file although I'm sure this can go in the module also:
I know this isn't the perhaps the best way of doing this but it works for me
Comment #4
marcus178 commentedI've given this a go by putting the first part in my custom.module and the other bit in my template.php by nothing seems to happen, I just get the normal popup which then posts to my profile wall.
Did you take any other steps to make this work?
Comment #5
vivianspencer commentedYou need to make sure you set YOUR_FACEBOOK_PAGE_ID to your page id in the preprocess function
I also found that on some occasions the first permissions dialog that pops up only selects your profile, if you click the dropdown in the permissions dialog it should list any pages also related to your facebook account. I haven't found a way around this yet.
Comment #6
marcus178 commentedNot really sure what's wrong just doesn't seem to do anything.
Comment #7
vivianspencer commentedCode looks fine to me, have you logged in via facebook connect?
Comment #8
marcus178 commentedYes i'm logged in with Facebook, I do get the popup to post to facebook but it's just the normal one that posts to my profile.
Comment #9
vivianspencer commentedOk, I'll put together a dev site later on and test your code
Are you sure you're using your page id?
Comment #10
marcus178 commentedShould the post to Facebook option be ticked in the Content type?
Still not got this to work, the correct dialogue box did popup once after asking permission but haven't been able to replicate that since.
Comment #11
marcus178 commentedFinally got it working, and you need to make sure posting to wall is not ticket for the content type.
The following code is in a custom module, just replace the xxxxxxxxxx with your page id. I have also include a image field in the attachment but that will need changing depending on your setup.
Comment #12
eranback commentedHi
Posting to a fan page or any other page would be easier to do using the "secret" email facebook suplly
also called
your_secret_email@m.facebook.com
the email uses to post photos / videos but also applicable for pure text
more info here - http://www.facebook.com/pages/edit/?id=103995946314195#!/help/?topic=pag...
bottom line: it would be easier to send an email than use fb-dff-connect-javascript-more
hope that's helps ...
as for me, I would like to update the user's feed/wall so I dont have the user's secret email (each facebook user have one) so it is little bit more complicated
Comment #13
e-fee commented@marcus: tried your piece of code, put it into a module.
First I get an error message like this:
Seems to refer to
in facebookapi_php5_restlib.php but I don't know what to do with that!
Seems to be treated as a posting to a friend's wall (actually it's supposed to be posting to my page which is connected with my app, both under the account which is connected), again an error message that it can't be posted.
After that it wants to post to my own wall and this works fine.
Comment #14
agira commentedSame I want to do for my facebook application wall, my website which use fbconnect is registered as facebook application, then any new nodes content from that my website i want to see not on my personal wall - but on application wall, searching now for solution.
Comment #15
butler360 commentedSubscribing.
Comment #16
benone commentedsubscribe