Topic-icon Button Image Tags

Active Subscriptions:

None
10 years 5 months ago #38456 by ringstonmedia
I would like to add an alt tag and title tag to the Facebook and Google buttons on the login module. Can you tell me how?

I am getting thousands error messages in Raven Tools during the audit process relating to these two button, and it is driving me nuts. Yup, I realize how insane that makes me sound.
The topic has been locked.
Support Specialist
10 years 5 months ago #38465 by alzander
Replied by alzander on topic Button Image Tags
ringstonmedia,
You'll need to edit 2 files to do what you're looking for. In the /components/com_jfbconnect/libraries/provider directory, there are facebook.php and google.php files. Edit those and look for "function getImageButton". You'll see something like:
private function getImageButton($buttonImage, $display, $alignment, $loginClass, $loginId)
    {
        return '<div class="' . $loginClass . ' pull-' . $alignment . '"><a' . $display . ' id="' . $loginId . '" href="javascript:void(0)" onclick="jfbc.login.google();"><img src="' . $buttonImage . '" /></a></div>';
    }
You can edit that line with the title/alt tag that you need. In the v5.2 release, there will be only one place to make that change so that it works for Facebook, Google and Twitter. I've also added this to our to-do list. I'd imagine that the v5.2.1 release will have the alt/title tags properly set.

I hope that helps,
Alex
The topic has been locked.
Active Subscriptions:

None
10 years 5 months ago #38491 by ringstonmedia
Replied by ringstonmedia on topic Button Image Tags
Thanks! It worked perfectly.
The topic has been locked.
Support Specialist
10 years 5 months ago #38494 by alzander
Replied by alzander on topic Button Image Tags
Awesome! Glad to hear that worked. Just to make sure (so we get it right), you added an alt to the image and a title to the link? This change can't make it into v5.2.0 (since it's coming out on Friday), but will be in v5.2.1. Feel free to post the updated line as well if you'd like :)

As always, should you need anything else, just let us know.

Thanks,
Alex
The topic has been locked.
Active Subscriptions:

None
10 years 5 months ago #38499 by ringstonmedia
Replied by ringstonmedia on topic Button Image Tags
Thanks again.

It was pretty simple, I added the following code:
{
        return '<div class="' . $loginClass . ' pull-' . $alignment . '"><a' . $display . ' id="' . $loginId . '" href="javascript:void(0)" onclick="jfbc.login.facebook();"><img src="' . $buttonImage . '" alt="Facebook Login" title="Facebook Login"/></a></div>';
    }

You can see the result at www.bestof516.com (a work in progress)

Attached are the two files with the code in place.
buttonTags.zip
The topic has been locked.
Support Specialist
10 years 5 months ago #38502 by alzander
Replied by alzander on topic Button Image Tags
Awesome. Thanks for letting me know what it was complaining about. The main thing I was curious about was the title tag. It's valid to be placed on both the 'a href' and the img tag, so wanted to make sure we got it right for what you're looking for. We'll be adding it to both in the 5.2.1 release either way, but always good to know.

Thanks,
Alex
The topic has been locked.
Support Specialist
10 years 5 months ago #38503 by alzander
Replied by alzander on topic Button Image Tags
Site's looking good, btw :)
The topic has been locked.