Last active
February 5, 2016 23:18
-
-
Save dotspencer/920929b97c2e8ed3aff5 to your computer and use it in GitHub Desktop.
Project Page Format - Researchers
Each researcher has a shortcode tag in the following format: [spencer_smith]
The shortcode will insert their information into the page.
The [auto_format]
shortcode takes care of the formatting, adding color, and generating the correct mailto: link.
"Simple" shortcode format for researchers:
<h4>
<a class="red" href="/about/staff/spencer-smith/">Spencer Smith</a>
801 900 3246
<a class="mail" href="mailto:[email protected]">[email protected]</a>
</h4>
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
echo ""; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var links = document.getElementsByTagName('a'); | |
var projectTitle = document.title.split('»')[1].trim(); | |
if(projectTitle.indexOf('&') != -1){ | |
projectTitle = projectTitle.replace('&', '%26') | |
} | |
for(i = 0; i < links.length; i++){ | |
if(links[i].href.indexOf('mailto:') != -1){ | |
links[i].href += "[email protected]&subject="; | |
links[i].href += projectTitle; | |
links[i].className += " red"; | |
} | |
} | |
var reds = document.getElementsByClassName('red'); | |
for(i = 0; i < reds.length; i ++){ | |
reds[i].parentNode.style.marginTop = "-10px"; | |
reds[i].parentNode.style.marginBottom = "-10px"; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
.red{ | |
color: #990000 !important; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment