Results 1 to 8 of 8
  1. #1
    Join Date
    Jan 2004
    Posts
    5
    Plugin Contributions
    0

    red flag Drop down list background colors ??

    On a product page that contains a drop down list for color selection "red", "green" & "amber" so on - is it possible to set the background color for each individual color item?

    What files would need to be edited for the drop down option on products?

  2. #2
    Join Date
    Apr 2006
    Location
    London, UK
    Posts
    10,569
    Plugin Contributions
    25

    Default Re: Drop down list background colors ??

    It's been a while since I looked at this, but I seem to remember that the answer last time around was that it was impossible to achieve this across all browsers (in particular Internet Explorer) without some javascript to force the issue.

    That's of course if you've worked out the Zen Cart coding changes needed to identify which entries should take which colors.

    If you Google css for pulldown menu background color, and avoid the answers that are actually for drop down menus, then you should be able to find more detail and solutions to the general issue.
    Kuroi Web Design and Development | Twitter

    (Questions answered in the forum only - so that any forum member can benefit - not by personal message)

  3. #3
    Join Date
    Jan 2004
    Posts
    5
    Plugin Contributions
    0

    Default Re: Drop down list background colors ??

    I know this can be done in html and javascript and that some browsers can't handle this unless some javascript is invoked. I have been digging in the file structure to find how the options and values are read for the products within the site but haven't come up with any answers yet before i mess with code.

  4. #4
    Join Date
    Jan 2004
    Posts
    5
    Plugin Contributions
    0

    Default Re: Drop down list background colors ??

    Has anybody a link to a forum or site on how the drop down forms work within zen?

  5. #5
    Join Date
    Apr 2006
    Location
    London, UK
    Posts
    10,569
    Plugin Contributions
    25

    Default Re: Drop down list background colors ??

    Pull down menus are built in Zen Cart by calling the following function
    zen_draw_pull_down_menu($name, $values, $default, $parameters, $required)
    which can be found in the html_output.php file in includes/functions
    Kuroi Web Design and Development | Twitter

    (Questions answered in the forum only - so that any forum member can benefit - not by personal message)

  6. #6
    Join Date
    Jan 2004
    Posts
    5
    Plugin Contributions
    0

    Default Re: Drop down list background colors ??

    I was looking in the right files but let's see if I am following this right.. the html_output.php file calls functions data for the pull down menus from the database for the product page?

    Quote Originally Posted by kuroi View Post
    Pull down menus are built in Zen Cart by calling the following function which can be found in the html_output.php file in includes/functions

  7. #7
    Join Date
    Apr 2006
    Location
    London, UK
    Posts
    10,569
    Plugin Contributions
    25

    Default Re: Drop down list background colors ??

    Afraid not. html_output is just a collection of functions used to format HTML quickly and consistently throughout Zen Cart. You still have to write code to extract the information you from the database and then pass it to the functions in html_output such as zen_draw_pull_down_menu().

    If you look at how each function works you will be able to see the format in which it expects this data. For example zen_draw_pull_down_menu() expects to receive an array of values passed as the second parameter. Each entry in this array is itself and associative array with keys 'id' for the selector value and 'text' for the text to be displayed for that selector.

    If the information that you want is already being produced by Zen Cart and you just want to format it differently and need extra CSS IDs or classes, then you would
    1. clone this function
    2. change the code to add your extras and give it a new name
    3. put the new function in a file in includes/functions/extra_functions
    4. change the function being called to you new one in the template for the page where you want your upgraded pull down to appear
    Kuroi Web Design and Development | Twitter

    (Questions answered in the forum only - so that any forum member can benefit - not by personal message)

  8. #8
    Join Date
    Feb 2008
    Posts
    118
    Plugin Contributions
    0

    Default Re: Drop down list background colors ??

    As a web designer who's done this on static sites, I was hoping to make this change as well...but it's too difficult with ZC.
    Has anyone hacked this yet? Could you map-it-out for the rest of us?


 

 

Similar Threads

  1. v139h Drop Down List
    By Bruce1952 in forum Templates, Stylesheets, Page Layout
    Replies: 2
    Last Post: 14 May 2012, 08:45 AM
  2. Changing background colors on drop down menus
    By jeremy0203 in forum Templates, Stylesheets, Page Layout
    Replies: 0
    Last Post: 27 Sep 2010, 04:07 AM
  3. Can we have Drop down menus to choose different colors?
    By swimmer35 in forum General Questions
    Replies: 1
    Last Post: 14 Feb 2010, 08:18 PM
  4. Background colour of drop-down boxes
    By Tanzanite in forum Templates, Stylesheets, Page Layout
    Replies: 4
    Last Post: 18 Dec 2006, 10:18 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
disjunctive-egg