Support Forums


Go Back   68 Classifieds Forums > Archives > Legacy Help & Support > v3.1 Modules & Modifications

 
LinkBack Thread Tools Display Modes
Old 11-18-2007, 06:03 PM   #1
Senior Member
 
Join Date: Jul 2007
Posts: 112
Rep Power: 10
Greg H is on a distinguished road
Default Search drop down list - Main Categories in BOLD

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
Greg H is offline   Reply With Quote
Old 11-19-2007, 08:58 AM   #2
Coder
 
Join Date: Mar 2006
Posts: 4,408
Rep Power: 108
Lhotch is just really niceLhotch is just really nice
Default

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?
__________________
Larry.
Lhotch is offline   Reply With Quote
Old 11-19-2007, 11:00 AM   #3
Senior Member
 
CHRD's Avatar
 
Join Date: Nov 2006
Posts: 190
Rep Power: 14
CHRD is on a distinguished road
Default

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.
CHRD is offline   Reply With Quote
Old 11-19-2007, 12:14 PM   #4
Senior Member
 
 
Join Date: Jan 2007
Posts: 365
Rep Power: 18
michael is a jewel in the rough
Default

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)
michael is offline   Reply With Quote
Old 11-20-2007, 04:12 PM   #5
Senior Member
 
Join Date: Jul 2007
Posts: 112
Rep Power: 10
Greg H is on a distinguished road
Default

Quote:
Originally Posted by Lhotch View Post
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?
Larry,

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
Greg H is offline   Reply With Quote
Old 11-20-2007, 05:02 PM   #6
Coder
 
Join Date: Mar 2006
Posts: 4,408
Rep Power: 108
Lhotch is just really niceLhotch is just really nice
Default

Quote:
Originally Posted by Greg H View Post
Like I said I only want the main cats bold and leave sub-cats as they are. Just like in CHRD's post.
I understand the goal but not where you were having problems.

Have you tried css?

<option style="font-weight: bold">your category here</option>
__________________
Larry.
Lhotch is offline   Reply With Quote
Old 11-20-2007, 10:11 PM   #7
Senior Member
 
Join Date: Jul 2007
Posts: 112
Rep Power: 10
Greg H is on a distinguished road
Default

Quote:
Originally Posted by Lhotch View Post
I understand the goal but not where you were having problems.

Have you tried css?

<option style="font-weight: bold">your category here</option>
Larry,

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
Greg H is offline   Reply With Quote
Old 11-21-2007, 08:15 AM   #8
Coder
 
Join Date: Mar 2006
Posts: 4,408
Rep Power: 108
Lhotch is just really niceLhotch is just really nice
Default

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>
__________________
Larry.
Lhotch is offline   Reply With Quote
Old 11-21-2007, 04:20 PM   #9
Senior Member
 
Join Date: Jul 2007
Posts: 112
Rep Power: 10
Greg H is on a distinguished road
Default

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
Greg H is offline   Reply With Quote
Old 11-21-2007, 05:36 PM   #10
Coder
 
Join Date: Mar 2006
Posts: 4,408
Rep Power: 108
Lhotch is just really niceLhotch is just really nice
Default

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}
$getcats is an array that has key and value pairs for all of the categories. The 'foreach' is a loop and what the above does is go through the complete array and for each key-value pair in the array an html option is created.

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}
__________________
Larry.
Lhotch is offline   Reply With Quote

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


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


All times are GMT -4. The time now is 12:20 PM.


Powered by vBulletin® Version 3.8.1
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0