SideBar Hiding Plugin
SideBar Hiding Plugin
Starting a new thread for this.
First question. As the SideBarItem, SideBarTitle and SideBarContent don't have id tags I need to locate them by the class attribute. To speed up the javascipt I would like to itterate through as few elements as possible. Can I make the following assumption about the tags these are going to be in?
SideBarItem in a div tag
SideBarTitle in an h3 tag
SideBarContent in a div tag
First question. As the SideBarItem, SideBarTitle and SideBarContent don't have id tags I need to locate them by the class attribute. To speed up the javascipt I would like to itterate through as few elements as possible. Can I make the following assumption about the tags these are going to be in?
SideBarItem in a div tag
SideBarTitle in an h3 tag
SideBarContent in a div tag
-
- Core Developer
- Posts: 30022
- Joined: Tue Sep 16, 2003 9:45 pm
- Location: Cologne, Germany
- Contact:
Re: SideBar Hiding Plugin
Can't you use document.getElementByClassname? Because it could be up to a template author to put stuff into a table or use a h2 instead of h3 item?
But basically you are right, all default-based templates will probably never change those tags.
Regards,
Garvin
But basically you are right, all default-based templates will probably never change those tags.
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/
# 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/
document.getElementByClassname doesn't exsist, I got a solution that should work fine though on any elements.
Things are looking promising as the trickest part is now done.
A CVS account for the plugin repository would be nice, you can e-mail me at tys@tvg.ca if the offer is still open.
Also working a simple plugin to combine two hidden sidebar items into a single sidebar item (ie a random image from a gallery using a url plugin, above an RSS feed from the gallery as a single sidebar).
Thanks,
Tys
Things are looking promising as the trickest part is now done.
A CVS account for the plugin repository would be nice, you can e-mail me at tys@tvg.ca if the offer is still open.
Also working a simple plugin to combine two hidden sidebar items into a single sidebar item (ie a random image from a gallery using a url plugin, above an RSS feed from the gallery as a single sidebar).
Thanks,
Tys
-
- Core Developer
- Posts: 30022
- Joined: Tue Sep 16, 2003 9:45 pm
- Location: Cologne, Germany
- Contact:
I'm a bit limited on time right now, but you'll get your CVS account shortly and can contribute this. Only thing I would like to ask you to is to use SPACES instead of TABS for indenting, and to properly indent all of the plugin code.
Regards,
Garvin
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/
# 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/
Will do, just used to using tabs at work, here everyone has different taste on tab width which is configurable in most editors. Plus I find it much easier to move around code. But I understand you want to keep everything consistent.
As for indenting, do you mean the outputted html? Or just the code itself?
As for indenting, do you mean the outputted html? Or just the code itself?
coool thing!!
I was pondering about writing something like this myself. great idea! I tried your plugin and it does everythin it should do (except throwing some errors, which apparently don't affect the functionality)
I am dealing with very limited space on my site www.twinblog.de/test since I have to squeeze two blog's on one site and have users who still use 800x600 as their screen resolution (... yes they still life).
With that in mind, hiding the sidebar with your plugin is not possible since everything, that makes the layout the slightest amount wider is unfotunateley not possible.
Did you ever think about hiding the sidebar completeley?
An just pop it up as it is needed?
I was thinking about something like this:
http://www.spiegel.de/wissenschaft/mens ... 64,00.html
If you hover over the button: "RESORT WÄHLEN" right under the "SPIEGEL ONLINE" Logo you can see a menu popping up right above the content... wouldn't this be great?
(since i am very bad coder - if i can call me a coder at all - I'd like to convince you to... but don't feel pressed. Only a suggestion)
greetinx
I am dealing with very limited space on my site www.twinblog.de/test since I have to squeeze two blog's on one site and have users who still use 800x600 as their screen resolution (... yes they still life).
With that in mind, hiding the sidebar with your plugin is not possible since everything, that makes the layout the slightest amount wider is unfotunateley not possible.
Did you ever think about hiding the sidebar completeley?
An just pop it up as it is needed?
I was thinking about something like this:
http://www.spiegel.de/wissenschaft/mens ... 64,00.html
If you hover over the button: "RESORT WÄHLEN" right under the "SPIEGEL ONLINE" Logo you can see a menu popping up right above the content... wouldn't this be great?
(since i am very bad coder - if i can call me a coder at all - I'd like to convince you to... but don't feel pressed. Only a suggestion)
greetinx
Thanks for the feedback. Can you give anymore details on the errors, they might not affect anything but it would be nice to squash them none the less.
Yes hiding the whole sidebar would be nice addition. Unfortunately I'm leaving the country in a week for 8 months and am really short in time to implement anything like this. Hiding the whole sidebar wouldn't be a difficult change. However displaying the link to pop the sidebar down in such a way that it would be generic and look good across all themes is a bit trickier.
Yes hiding the whole sidebar would be nice addition. Unfortunately I'm leaving the country in a week for 8 months and am really short in time to implement anything like this. Hiding the whole sidebar wouldn't be a difficult change. However displaying the link to pop the sidebar down in such a way that it would be generic and look good across all themes is a bit trickier.
-
- Core Developer
- Posts: 30022
- Joined: Tue Sep 16, 2003 9:45 pm
- Location: Cologne, Germany
- Contact:
shorshe, if you need a solution fast:
Anywhere on your site put this:
That piece of code should hide your left/right sidebar. You could put it anywhere inside of any Smarty .tpl file of your template (index.tpl, for example).
This is much more easier than only hiding certain elements, so basically this could be solved more cleanly in your template than with a plugin.
Regards,
Garvin
Anywhere on your site put this:
Code: Select all
<script type="text/javascript">
function toggleBar(id) {
obj = document.getElementById('id')
if (obj.style.display == 'none') {
obj.style.display = 'block';
} else {
obj.style.display = 'none';
}
}
</script>
<a href="#" onclick="javascript:toggleBar('serendipityRightSideBar')">Right</a>
<a href="#" onclick="javascript:toggleBar('serendipityLeftSideBar')">Left</a>
This is much more easier than only hiding certain elements, so basically this could be solved more cleanly in your template than with a plugin.
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/
# 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/
Ok: i get errors, if no plugins are installed in the left or right sidebar.Tys wrote:Thanks for the feedback. Can you give anymore details on the errors, they might not affect anything but it would be nice to squash them none the less.
se here:
too bad...Tys wrote: Yes hiding the whole sidebar would be nice addition. Unfortunately I'm leaving the country in a week for 8 months and am really short in time to implement anything like this. Hiding the whole sidebar wouldn't be a difficult change.
but good luck and have a nice stay!
yes, indeed. (thinking of kubrick...)Tys wrote:However displaying the link to pop the sidebar down in such a way that it would be generic and look good across all themes is a bit trickier.
Thanks!garvinhicking wrote: That piece of code should hide your left/right sidebar. You could put it anywhere inside of any Smarty .tpl file of your template (index.tpl, for example).
l'll try it NOW
-----edit---------
Code: Select all
Fatal error: Smarty error: [in /www/htdocs/twinblog//77/77blog/templates/default/index.tpl line 24]: syntax error: unrecognized tag 'obj' (Smarty_Compiler.class.php, line 580) in /www/htdocs/twinblog/77/77blog/bundled-libs/Smarty/libs/Smarty.class.php on line 1088
i put it in index.tpl...
Last edited by shorshe on Tue Apr 26, 2005 8:34 pm, edited 1 time in total.
-
- Core Developer
- Posts: 30022
- Joined: Tue Sep 16, 2003 9:45 pm
- Location: Cologne, Germany
- Contact:
Shorshe, also make sure you're using the latest version of the hider plugin! It seems you are using an older version; the error you're reporting was fixed in a previous version by me.
Regards,
Garvin
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/
# 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/
I use the newest version i can get from here:garvinhicking wrote:Shorshe, also make sure you're using the latest version of the hider plugin! It seems you are using an older version; the error you're reporting was fixed in a previous version by me.
http://cvs.sourceforge.net/viewcvs.py/p ... ebarhider/
(I just downloaded the files again to make shure).
still i can see these errors.