Skip to content
This repository has been archived by the owner on Nov 9, 2017. It is now read-only.

Customizing the facebook button #287

Open
qdelettre opened this issue Sep 23, 2013 · 4 comments
Open

Customizing the facebook button #287

qdelettre opened this issue Sep 23, 2013 · 4 comments

Comments

@qdelettre
Copy link

I would like to change the button image to another.

How can i do that ?

@Molkobain
Copy link

You make your own FB Connect button using the facebook_login_url helper. Here an example from my website :
Edit : It's not an helper actually but a URL get from the FB API. See next post.

<div class="co_co_button" id="fb_button">
    {{ facebook_initialize({'xfbml': true, 'fbAsyncInit': 'onFbInit();'}) }}
    <a href="{{facebook_login_url}}" title="{{ 'security.login.social_connect.connect_facebook' | trans({}, 'EPUserBundle')}}">
        <img src="/images/pictos/connect-fb.png" alt="{{ 'security.login.social_connect.connect_facebook' | trans({}, 'EPUserBundle')}}" />
        <div class="co_co_button_label">
            <span>{{ 'security.login.social_connect.connect_facebook' | trans({}, 'EPUserBundle')}}</span>
        </div>
    </a>
</div>

image

@qdelettre
Copy link
Author

facebook_login_url helper ? facebook_login_url is not defined for me.

@Molkobain
Copy link

My bad, I thought it was an helper but it actually an URL I retrieved from the API. I should have read the code completly. :)
Edit : But you can come with your own helper of course.

You can get the url from

$facebookLoginUrl = $this->container->get('fos_facebook.api')->getLoginUrl(array('redirect_uri'=> $this->container->get('router')->generate('fos_fb_security_check', array(), true) ));

@balvirsingh
Copy link

I implemented this in my page but it is not return email of user. so how can i get email of user ?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants