Expand/Collapse Commentform
Posted: Sun Sep 07, 2008 4:21 pm
Hey guys,
I wonder wether it's possible to make the Commentform expandable. I would like it to be initially hidden and by clicking on the headline it should be expanded. I found a script for doing this, but when I implement it I got this error message:
And this code in to entries.tpl where the commentform is displayed:
I don't know wether this is the best way to get it going, maybe you know a better one, but it would work fine for me, if somebody could solve this problem 
I wonder wether it's possible to make the Commentform expandable. I would like it to be initially hidden and by clicking on the headline it should be expanded. I found a script for doing this, but when I implement it I got this error message:
So does anybody know what I did wrong? I wrote this code into my index.tpl between <head> </head>:Fatal error: Smarty error: [in /xxx/templates/xxx/index.tpl line 23]: syntax error: unrecognized tag 'ie4' (Smarty_Compiler.class.php, line 590) in /xxx/bundled-libs/Smarty/libs/Smarty.class.php on line 1092
Code: Select all
<script language="javascript">
var ie4 = false; if(document.all) { ie4 = true; }
function getObject(id) { if (ie4) { return document.all[id]; } else { return document.getElementById(id); } }
function toggle(link, divId) { var lText = link.innerHTML; var d = getObject(divId);
if (lText == '+') { link.innerHTML = '-'; d.style.display = 'block'; }
else { link.innerHTML = '+'; d.style.display = 'none'; } }
</script>Code: Select all
<a title="show/hide" id="expand_link" href="javascript: void(0);" onclick="toggle(this, 'expand');">-</a>
<div id="expand">{$COMMENTFORM}
</div><noscript>You have to enable javascript to see this content.</noscript>
<script language="javascript">toggle(getObject('expand_link'), 'expand');</script>