Template Hacks
MT Hacks has brought out a new version of FormatList. This one is version 1.4 which has new icons and improved code. FormatList is a perl script that adds buttons to the entry templates to let you format bulleted and numbered lists.
Another great piece of code I added to the templates is Show/Hide Extended Entries. Normally when you click on the Read More link, you're redirected to the individual entry. This Javascript code shows you the rest of the entry on the same page. Show More » turns into « Hide More when the entry is expanded.
Try it...
The code is very easy to implement. Copy and paste the javascript code into the head section of your main index, date and category archive templates. ar1232 = ('varXYZ2' + (varA12));
<script language="javascript">
function showMore(varA1, varB1){
var123 = ('varXYZ' + (varA1));
varABC = ('varP' + (varA1));
if( document.getElementById ) {
if( document.getElementById(var123).style.display ) {
if( varB1 != 0 ) {
document.getElementById(var123).style.display = "block";
document.getElementById(varABC).style.display = "none";
} else { document.getElementById(var123).style.display = "none";
document.getElementById(varABC).style.display = "block"; }
} else { location.href = varB1;
return true; }
} else { location.href = varB1;
return true; }
}
</script>
The following code needs to replace the <MTEntryIfExtended> code.
<MTEntryIfExtended>
<span id="varP<$MTEntryID$>"><p><a href="<$MTEntryLink$>#<$MTEntryID pad="1"$>" onclick="showMore(<$MTEntryID$>,'<$MTEntryLink$>#
<$MTEntryID pad="1"$>');return false;">show more »</a></p><br /></span><div id="varXYZ<$MTEntryID$>" style="display: none"><p><$MTEntryMore$></p><p><a href="#<$MTEntryID pad="1"$>" onclick="showMore(<$MTEntryID$>,0);return
true;">« hide more</a></p></div>
</MTEntryIfExtended>
It's possible to set this up for expanding and collapsing comments too. Check out Scripty Goddess for the code.



Leave a comment