Support Forum

Advanced Search
Forum Scope


Match



Forum Options



Minimum search word length is 3 characters - maximum search word length is 84 characters
general-topic
Adding button or link to the SP header area
Avatar
Stan Dahl
Member
sp_UserOfflineSmall Offline
Feb 24, 2018 - 3:23 pm

Hi guys,

Does SP have any plugins, or do you have any suggestions, for adding a button (with a link to a Wordpress page) next to the Member's button up at the top of forum pages?

Our forum is based on training content, and we'd like to have a link to that content page for easy access.

Doesn't have to be next to the Member's button, but we'd like it to be somewhere up in the header area or even a breadcrumb link would probably work.

Any suggestions for adding something like that to the top SP header area?

Thanks,

Pete

Avatar
Mr Papa
Simi Valley, CA
SP Master
Free Members
sp_UserOfflineSmall Offline
Feb 24, 2018 - 3:37 pm

we have an API function for that!

function sp_AddButton($args = '', $label = '', $toolTip = '', $perm = '', $buttonID = '') {
 $defs = array('tagId' => $buttonID,
 'tagClass' => 'spButton',
 'link' => SP()->spPermalinks->get_url(),
 'icon' => '',
 'iconClass' => 'spIcon',
 'mobileMenu' => 0,
 'echo' => 1,);

is the prototype...  so call it with the desired arguments from where you want the button to display... if in the header, you would add it to the spHeadDesktop.php function if using Barebones... basically, the header template file...  add it where you want it to appear...

as always, we suggest creating a child theme and then updating the template file there...

Avatar
Stan Dahl
Member
sp_UserOfflineSmall Offline
Feb 24, 2018 - 5:15 pm

Awesome!

Thanks, Mr. Papa... appreciate the help.

Avatar
Mr Papa
Simi Valley, CA
SP Master
Free Members
sp_UserOfflineSmall Offline
Feb 24, 2018 - 7:13 pm

glad to help... think you have done this sort of stuff before, so didnt provide low level details, but holler if you need a bit more...

Avatar
Stan Dahl
Member
sp_UserOfflineSmall Offline
Mar 6, 2018 - 2:55 pm

Got it.

Figuring this code out is beyond my scope.

Do you have anyone there that can help us out with some custom work?

 

Thanks,

Pete

Avatar
Yellow Swordfish
Glinton, England
SP Master
sp_UserOfflineSmall Offline
Mar 6, 2018 - 3:37 pm

Very tricky at the moment as we are a bit snowed under but... if you can describe what it is you are trying and wanting to do we should be able to advise for starters...

andy-signature.png
YELLOW
SWORDFISH
Avatar
Stan Dahl
Member
sp_UserOfflineSmall Offline
Mar 6, 2018 - 5:47 pm

Any direction would be appreciated.

We're using the default theme (no child theme) and are trying to get put a button ("SWS Lessons") next to the "Members" Button in the header that links to a regular wordpress page.

I can find spHead.php file, but I can't find spHeadDesktop.php and I'm not sure how to string together that code.  I can see the code for the other buttons in the spHead.php file, but haven't been able to get it to work.

Thanks,

Pete

Avatar
Mr Papa
Simi Valley, CA
SP Master
Free Members
sp_UserOfflineSmall Offline
Mar 6, 2018 - 10:47 pm

so, yes, if you are using the old default theme, the file is spHead.php...  something like this where you want it...

sp_AddButton('tagClass=spButton spRight&link=http://yourpage.com', 'SWS Lessons', 'Visit SWS Lessons');

try that and we can customize more if needed... of course, change the url after &link to be url to your page...

Avatar
Stan Dahl
Member
sp_UserOfflineSmall Offline
Mar 7, 2018 - 3:39 pm

That did the trick.

Many thanks for the help,

Pete

Avatar
Yellow Swordfish
Glinton, England
SP Master
sp_UserOfflineSmall Offline
Mar 8, 2018 - 3:56 am

Glad to hear that and you are more than welcome.

andy-signature.png
YELLOW
SWORDFISH
Forum Timezone: Europe/Stockholm
Most Users Ever Online: 1170
Currently Online:
Guest(s) 1
Currently Browsing this Page:
1 Guest(s)
Top Posters:
Mr Papa: 19448
Ike: 2086
Brandon: 864
kvr28: 804
jim: 650
FidoSysop: 577
Conrad_Farlow: 531
fiddlerman: 358
Stefano Prete: 325
Member Stats:
Guest Posters: 620
Members: 17365
Moderators: 0
Admins: 4
Forum Stats:
Groups: 7
Forums: 17
Topics: 10128
Posts: 79626