| View previous topic :: View next topic |
| Author |
Message |
jamesf Guest
|
Posted: Fri Aug 26, 2005 11:39 am Post subject: dropdown category fix |
|
|
Hi,
To get around the category dropdown bug you
need to replace this code:
<form action="" method="POST">
<p style="padding: 0px; margin: 0px;">
{dropdown_cats optionall='0' all='All' sort_column='name'}
<input type="submit" name="submit" value="GO" /></p>
</form>
with this code:
<form name="category" action="" method="POST">
<p style="margin: 0px; padding: 0px;">
{blogsome_dropdown_cats optionall='0' all='All' sort_column='name'}
<input type="button" value="Go" onclick="window.location = (document.category.cat.options[document.category.cat.selectedIndex].value);" /></p>
</form>
You can see it in action on:
http://blogsometeam.blogsome.com
If you need me to clear out your smartycache to get it to work or have suggestions please post a reply
Jamesf
[Moderator Edit: removed superfluous line break to fix code] |
|
| Back to top |
|
schinckel
Joined: 03 Apr 2005 Posts: 1238 Location: Adelaide, Australia
|
Posted: Sat Aug 27, 2005 12:25 pm Post subject: |
|
|
This is very cool, jamesf, thanks for that.
(I had to remove a line break from in your code, I've taken the liberty of editing the post).
I noticed that you have the same type of thing going on for archives. The closest I can get is:
| Code: | <form name="archiveform" action="" method="POST">
<p style="margin: 0px; padding: 0px;">
{blogsome_dropdown_arcs optionall='0' all='All' sort_column='name'}
<input type="button" value="Go" onclick="window.location = (document.forms.archiveform.archive_chrono[document.forms.archiveform.archive_chrono.selectedIndex].value);" /></p>
</form>
|
But I don't know the tag I need to use instead of {blogsome_dropdown_arcs}
I also noticed that this is a special {blogsome_} smarty tag - are there any more of these you can tell us about? _________________ Blogsome Forum: Rules/Search
WordPress Codex; Smarty Tags Docs |
|
| Back to top |
|
schinckel
Joined: 03 Apr 2005 Posts: 1238 Location: Adelaide, Australia
|
Posted: Sat Aug 27, 2005 12:33 pm Post subject: |
|
|
Egg on face: I should do what I tell others to do, and check the codex...
| Code: | <form name="archiveform" action="" method="POST">
<p style="margin: 0px; padding: 0px;"><select id="archive_chrono">
<option value=''>Select Month to View</option>
{get_archives type='monthly' format='option'}
<input type="button" value="Go" onclick="window.location = (document.forms.archiveform.archive_chrono[document.forms.archiveform.archive_chrono.selectedIndex].value);" /></p>
</form>
|
Will do the trick... _________________ Blogsome Forum: Rules/Search
WordPress Codex; Smarty Tags Docs |
|
| Back to top |
|
johnt
Joined: 07 Feb 2005 Posts: 148 Location: Perth, Australia
|
Posted: Mon Aug 29, 2005 1:29 am Post subject: |
|
|
| is it possible to do a drop-down menu for Links such as your Blogroll |
|
| Back to top |
|
schinckel
Joined: 03 Apr 2005 Posts: 1238 Location: Adelaide, Australia
|
Posted: Mon Aug 29, 2005 3:04 am Post subject: |
|
|
You'd think so. I got to this stage:
| Code: | <form name="linksform" action="" method="POST">
<p style="margin: 0px; padding: 0px;"><select id="links_chooser">
<option value=''>Select Link to Visit</option>
{get_links before='<option value=" after='</option>'}
<input type="button" value="Go" onclick="window.location = (document.forms.linksform.links_chooser[document.forms.linksform.links_chooser.selectedIndex].value);" /></p>
</form> |
But this won't quite work: you can choose a link, but it will not follow it. There doesn't seem to be a way to tell it to put the URL of the link into the value field of the option marker: each item is already an a href link, and cannot be split.
It might be possible to do it using smarty tags: {capture}, and splitting the text, but that will be ugly!
I'm guessing this is the same issue that arose for the categories one. Can we have {blogsome_dropdown_links} tag made, please? (There isn't one, AFAICS). _________________ Blogsome Forum: Rules/Search
WordPress Codex; Smarty Tags Docs |
|
| Back to top |
|
inkblotter
Joined: 21 Jul 2005 Posts: 10
|
Posted: Tue Sep 06, 2005 3:23 pm Post subject: |
|
|
I used this code in my sidebar for the Archives dropdown, and it worked like a charm:
| Code: | <form id="archiveform" action="">
<select name="archive_chrono" onchange="window.location =
(document.forms.archiveform.archive_chrono[document.forms.archiveform.archive_chrono.selectedIndex].value);" />
<option value=''>Select Month</option>
{get_archives type='monthly' format='option'}
</select>
</form> |
|
|
| Back to top |
|
outonthefringe
Joined: 09 Jan 2006 Posts: 9
|
Posted: Thu Sep 28, 2006 2:12 pm Post subject: Category dropdown without 'Go' button |
|
|
OK, I pieced together how to do this with my Archives and Links, but have no idea how to fix it with my Categories. (See my blog to see how I have them.) I want to have the Categories links work without having to click the 'Go' button.
I've pieced this together, but it doesn't work. I have to admit I have no idea what I'm doing. What do you guys think?
| Code: |
<form id="category" action="">
<select name="cat_list" onchange="window.location = (document.category.cat.options[document.category.cat.selectedIndex].value);" />
<option value=''>Select Category</option>
{capture name="catslist"}{blogsome_cats optionall='0' all='All' sort_column='name'}{/capture}
{$smarty.capture.catslist|replace:'<a':'<option'|replace:'</a>':'</option>'|replace:'href':'value'}
</form>
|
_________________ Stephen
http://regen2.blogsome.com |
|
| Back to top |
|
|