SideBar Hiding Plugin

Creating and modifying plugins.
garvinhicking
Core Developer
Posts: 30022
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany
Contact:

Post by garvinhicking »

Shorshe, I just made another fix which should get rid of the foreach() error. Just replace

Code: Select all

if ($plugins_left)
if ($plugins_right))
to

Code: Select all

if (is_array($plugins_left))
if (is_array($plugins_right))
inside the plugin file.

About your smarty templating error: if you insert { and } tags into Serendipity templates you need to escape them, as they are recognized as Smarty tags usually.

You need to write {ldelim} and {rdelim} instead, see http://smarty.php.net/manual/en/language.escaping.php

Regards,
Garvin
# Garvin Hicking (s9y Developer)
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
shorshe
Regular
Posts: 14
Joined: Fri Jan 23, 2004 5:37 pm

Post by shorshe »

So

Code: Select all

<script type="text/javascript"> 
function toggleBar(id) {ldelim}
  obj = document.getElementById('id') 
  if (obj.style.display == 'none') {ldelim} 
    obj.style.display = 'block'; 
  {rdelim} else {ldelim} 
    obj.style.display = 'none'; 
  {rdelim} 
{rdelim} 
</script> 
<a href="#" onclick="javascript:toggleBar('serendipityRightSideBar')">Right</a> 
<a href="#" onclick="javascript:toggleBar('serendipityLeftSideBar')">Left</a>
would be the right thing to to?... i'll try this
Post Reply