PuckPedia Tools


PuckPedia Website Connector

PuckPedia Connector is a tool that allows you to easily enhance the content of your hockey website's content with inline player and team data supplied by PuckPedia. This tool will automaticaly convert NHL player and team names on your website into links with real time stats, contract info and salary cap data.


The text below is a standard block of text. All of the links you see have been added automatically, in real-time, by the PuckPedia Connector.

In an unprecedented 2020 NHL season, the Tampa Bay Lightning defeated the Dallas Stars to win the Stanley Cup in Edmonton, home of the Edmonton Oilers. With 34 points, Nikita Kucherov lead the league in playoff scoring, while Victor Hedman won the Conn Smythe Trophy as playoff MVP.

After being eliminated in the play-in round, the New York Rangers won the draft lottery and selected Alexis Lafreniere with the first overall pick in the entry draft.

Get Started

If you cannot edit your website template/theme, or add code snippets to your website, check out our Link Maker Tool, or PuckPedia Wordpress Plugin options.

Add style and script links to your template
First you’ll need to add the following code to your template right before the closing </head> tag.
  <link rel="stylesheet" href="https://puckpedia.com/connector/styles" />
<script src="https://puckpedia.com/connector/script" defer></script>
Add script tag, customized to suit your needs
Next, add the following code snippet to your page template at the end of the </body> tag. Update the script paramaters to fit your use case. See below for explanation of each option.
  var ppOptions = {
    targetSelector: ".content",
    scope: "all",
    linkMode: "popup",
    linkTarget: "_blank",
Supported Parameters
targetSelector CSS selector for the wrapper element that contains your article content. It is recommended to set this to a value specific to your site rather than using the default and to be as specific with your selector as possible. Using the default value may cause performance issues, or unexpected results on your page.
Default: "body p"
scope Specify whether popovers or links should be created for players, teams, or all. Valid options are "all", "players", or "teams".
Default: "all"
linkMode Specify whether to insert popovers or simple links to PuckPedia.com. Valid options are "popup" or "link".
Default: "popup"
linkTarget Specify if links clicked will open a new browser tab or not. Valid options are "_blank" or "_self".
Default: "_blank"
pathPattern A regular expression to match against to determine whether or not to do name replacements on a page. Omit this option to enable on all pages.

Example: /^\/article\// will match any path that starts with /article/.

See: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/match


Hit A Snag?

Not seeing names linked as you expect?

To identify possible names in your content, our script is looking for multiple capitalized words in succession. In most cases this works well, but if a player's name has additional capitalized words before or after it, we may have trouble picking out the name.

Try another method:

1 - Try our PuckPedia Connector - Link Maker Tool
2 - Try the PuckPedia Connector - Wordpress plugin

Other Issues?

Contact PuckPedia