|
|
#1 |
|
Senior Member
Join Date: Jul 2007
Posts: 112
Rep Power: 10 ![]() |
My client has requested that all the main categories be BOLD in the search drop-down list. Just the main cats, I want the sub-cats to remain as they are.
The reason is that I have a large number of categories and sub-categories and this will make it easier to see/choose the main categories. Can anyone point me in the right direction please? Thank You
__________________
Greg Version 3.1.9 and 4.0.3 Developer |
|
|
|
|
|
#2 |
|
Coder
Join Date: Mar 2006
Posts: 4,408
Rep Power: 108 ![]() ![]() |
Where are you having problems, actually making items in the dropdown bold or determining which are main categories so that you can make them bold?
|
|
|
|
|
|
#3 |
|
Senior Member
Join Date: Nov 2006
Posts: 190
Rep Power: 14 ![]() |
yes in the search CAT drop down it would be good to see main cats in bold and sub cats in normal font:
Main Cat >>Sub Cat Im sure its here in the includes/functions.php, Im might be wrong // get the category tree function cat_tree($prefix, $parent) { global $db; $arr = array(); $sSQL="SELECT id,name,cOrder FROM ".PREFIX."categories WHERE parent_id=".$parent." AND display<>'N' AND cLink='' ORDER BY cORDER DESC, name ASC"; $result=$db->query($sSQL); while($row = $result->fetch()) { $id=$row['id']; $row['name'] = $prefix . safeStripSlashes($row['name']); array_push($arr, $row); $arr = array_merge($arr, cat_tree($prefix ." » ", $id)); } return $arr; }
__________________
Costa del Sol Spain v3.1.10 Dev V4.09 Dev sweeeet �Powerful you have become, the dark side I sense in you.� Last edited by CHRD; 11-19-2007 at 11:23 AM. |
|
|
|
|
|
#4 |
|
Senior Member
Join Date: Jan 2007
Posts: 365
Rep Power: 18 ![]() |
This is supposed to be coming in Version 4. Separate CSS for drop-down menu's?
__________________
M Michael V4.1.3 Developer - 3 Column Default Template "All truths are easy to understand once they are discovered; the point is to discover them" - Galileo Galilei (1564 - 1642) |
|
|
|
|
|
#5 | |
|
Senior Member
Join Date: Jul 2007
Posts: 112
Rep Power: 10 ![]() |
Quote:
Im having a problem with trying to make them BOLD, I know which ones are main cats. Like I said I only want the main cats bold and leave sub-cats as they are. Just like in CHRD's post. Thanks
__________________
Greg Version 3.1.9 and 4.0.3 Developer |
|
|
|
|
|
|
#6 | |
|
Coder
Join Date: Mar 2006
Posts: 4,408
Rep Power: 108 ![]() ![]() |
Quote:
Have you tried css? <option style="font-weight: bold">your category here</option> |
|
|
|
|
|
|
#7 | |
|
Senior Member
Join Date: Jul 2007
Posts: 112
Rep Power: 10 ![]() |
Quote:
Ive looked at the css, particularly the style.css file, input, select, textarea (line 350) { border-top-width: 1px; border-right-width: 1px; border-bottom-width: 1px; border-left-width: 1px; border-top-style: solid; border-right-style: solid; border-bottom-style: solid; border-left-style: solid; border-top-color: #000000; border-right-color: #000000; border-bottom-color: #000000; border-left-color: #000000; color: #000000; background-color: #ffffff; font-family: Verdana,Arial,Geneva; font-size: 10px; } I dont see how I can do it here...how could I make the main categories show as bold and subs as standard txt. I dont see how I can differentiate between the two in the style sheet. Remember this for the drop down category search function.
__________________
Greg Version 3.1.9 and 4.0.3 Developer |
|
|
|
|
|
|
#8 |
|
Coder
Join Date: Mar 2006
Posts: 4,408
Rep Power: 108 ![]() ![]() |
I just showed how by using a style associated with the given option in the template, A dropdown is made up of multiple <options>, add a style to the ones you want bold, ie...
<option style="font-weight: bold">your category here</option> |
|
|
|
|
|
#9 |
|
Senior Member
Join Date: Jul 2007
Posts: 112
Rep Power: 10 ![]() |
Larry,
Thanks for helping, Im almost there. I have a good knowledge of html, I just didnt know where to put it. Ive managed to make ALL categories BOLD but I only want the main categories to be. The changes I made are in red (search.tpl.php) <tr> <td valign="top" class="formleft">{$smarty.const.LANG_SEARCH_INCAT} {$smarty.const.LANG_COLON}</td> <td valign="top" class="formright"> <select name="type" id="type" onChange="displaySec(this);"> <option value=''>{$smarty.const.LANG_SEARCH_ALLCAT}</option> {foreach from=$getcats item=cat} <option style="font-weight: bold" value="{$cat.id}"{if $type==$cat.id} SELECTED{/if}>{$cat.name}</option> {/foreach} </select> </td> </tr> I also tried it on the line two lines above, but this just made the words "Search All" to become bold. Looking at the whole file it seems to me that I wont be able to achieve what I want, not in this file anyway. Just to be clear....Its only the main cats I want bold, not sub-cats. The purpose is to make it easier for users to scroll through the large list of cats that I have. Thanks Greg
__________________
Greg Version 3.1.9 and 4.0.3 Developer |
|
|
|
|
|
#10 |
|
Coder
Join Date: Mar 2006
Posts: 4,408
Rep Power: 108 ![]() ![]() |
Thats why I asked if you needed just help with just making dropdown options bold or also help in how to make the desired options bold, turns out ya needed help with both
.the following template code from your above post builds the dropdown. Code:
{foreach from=$getcats item=cat}
<option style="font-weight: bold" value="{$cat.id}"{if $type==$cat.id} SELECTED{/if}>{$cat.name}</option>
{/foreach}
What your likely going to have to do is add logic to the foreach loop to check the $cat.id and if it equals a number you know is a main category then add the style and if not, dont add the style. So, lets say you have a few main categories and they have id's of 9, 14 and 23 you would want something like this.... Code:
{foreach from=$getcats item=cat}
{if $cat.id == '9' or $cat.id == '14' or $cat.id == '23'}
<option style="font-weight: bold" value="{$cat.id}"{if $type==$cat.id}SELECTED{/if}>{$cat.name}</option>
{else}
<option value="{$cat.id}"{if $type==$cat.id}SELECTED{/if}>{$cat.name}</option>
{/if}
{/foreach}
|
|
|
|
| Bookmarks |
| Thread Tools | |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Only display main cats in category drop down? | wiredhat | v3.1 Questions & Support | 10 | 02-07-2007 02:59 PM |
| city drop down won't search | NetGirl | v3.1 Questions & Support | 7 | 12-10-2006 11:15 PM |
| Categories to be listed in a list menu rather that in a text | marketingsolutions | v3.1 Modules & Modifications | 21 | 10-15-2006 08:41 AM |
| Select field problem (extra field --> drop down list) | pat01 | v3.1 Questions & Support | 1 | 08-10-2006 02:05 AM |
| Drop Down Search Issue | CB | v3.1 Questions & Support | 2 | 06-23-2006 12:04 AM |