Support Forum

Removing the icons inside buttons?

MB Matthew Bonner
Matthew Bonner
Member

Is there a way to remove the icons inside buttons (mainly “Login”and “Search” buttons) so that the button just shows the text? (Like the Submit, Cancel and Preview Buttons)

10 Answers

New Answer

YS Yellow Swordfish
Yellow Swordfish
Member

Yes indeed. You will need to make some edits to the SP theme templates – both search and login are in the spHead.php template.

For the Login button you will need to locate the function call to sp_LogInOutButton(). By defaulkt it will probably look like this:

sp_LogInOutButton('tagClass=spButton spRight', __sp('Log In'), __sp('Log Out'), __sp('Log in and log out'));

You need to add two arguments for the two different icons like so:

sp_LogInOutButton('tagClass=spButton spRight&logInIcon=&logOutIcon=', __sp('Log In'), __sp('Log Out'), __sp('Log in and log out'));

be careful – note the ampersands and the use of case in the new arguments. They must be entered correctly.

The search is the same – the function is sp_SearchForm() but in this case, there is only one icon and the new argument to be added is icon=

As always we recommend that you create your own SP theme so that any customisation is not lost during a future update. (http://codex.simple-press.com/codex/themes/theme-basics/creating-a-theme/)

MB Matthew Bonner
Matthew Bonner
Member

Okay, LogInOut Button went smoothly. But I’m having trouble understanding the process for the search button

YS Yellow Swordfish
Yellow Swordfish
Member

I’m sorry – I gave you bad advice. I wasn’t thinking straight. Apologies.

The search button is part of the search form so has a different format. Right at the top of the template you will find two form object definitions. The second one is the search form. Locate the icon entry and remove the icon file name. Just leave the two empty single quote marks there.

MB Matthew Bonner
Matthew Bonner
Member

I’m left with a broken image link next to the search. Can you post an example?

MB Matthew Bonner
Matthew Bonner
Member

No only that now when I tick “Advance Search” it doesn’t drop down, it points to spSearch.png.

YS Yellow Swordfish
Yellow Swordfish
Member

I don’t believe this! That is a genuine bug in the code. It isn’t dropping the image tag as it is supposed to do if there is no icon defined – like the login button did.
I will make sure that is fixed up quickly. I can post the code here if you want to the make the change

YS Yellow Swordfish
Yellow Swordfish
Member

I’ll do it anyway.

The file is /simple-press/forum/content/sp-common-view-functions.php

The function is sp_SearchForm()

Locate the line of code that starts:

$out.= "<a rel='nofollow' id='$submitId' class='$submitClass vtip'.....

And replace it with this block of code:

    $out.= "<a rel='nofollow' id='$submitId' class='$submitClass vtip' title='$toolTip' onclick='jQuery(document).ready(function() { spjValidateSearch({$sfglobals['mysql']['search']['min']}); });'>";
    if(!empty($icon)) {
        $out.= "<img class='$iconClass' src='".SPTHEMEICONSURL.$icon."' alt=''/>";
    }
    $out.= "$submitLabel</a>";

Which should do the trick.

MB Matthew Bonner
Matthew Bonner
Member

I saved a copy of the file before the changes, now I’m back to square one after the LogInOut button success. I don’t want to changed something important I can fix I’d prefer if you could just post the code needed to change; search, profile, add topic, add reply, and edit. I’m trying to conserve space while keeping the current page format with sidebar.

 

MB Matthew Bonner
Matthew Bonner
Member

Yellow Swordfish said
I’ll do it anyway.

The file is /simple-press/forum/content/sp-common-view-functions.php

The function is sp_SearchForm()

Locate the line of code that starts:

$out.= "<a rel='nofollow' id='$submitId' class='$submitClass vtip'.....

And replace it with this block of code:

    $out.= "<a rel='nofollow' id='$submitId' class='$submitClass vtip' title='$toolTip' onclick='jQuery(document).ready(function() { spjValidateSearch({$sfglobals['mysql']['search']['min']}); });'>";
    if(!empty($icon)) {
        $out.= "<img class='$iconClass' src='".SPTHEMEICONSURL.$icon."' alt=''/>";
    }
    $out.= "$submitLabel</a>";

Which should do the trick.

laugh Works

MP Mr Papa
Mr Papa
Member

thanks for the confirmation… will be in the next release… so no worries about it overwriting your changes…