SideBar Hiding Plugin

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

Post by garvinhicking » Tue Apr 26, 2005 9:05 pm

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 6:37 pm

Post by shorshe » Tue May 03, 2005 11:49 pm

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