1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Displaying extra field list drop-down options in template (not values)

Discussion in 'Templates, HTML, CSS, and Design Help' started by awbrys, Aug 8, 2012.

  1. awbrys New Member

    Hi there

    I need to get from the database a list of all option names for a particular drop-down extra field that I've created. For example, I have created a drop down list in the extra fields section with 20 options, and I need dynamically show in the footer all 20 available drop-down options as plain text. Is this possible?

    Thanks,
    Awbrys
  2. Mike-N-Tosh Owner

    I moved this thread since it has absolutely nothing to do with any product from TemplateCodes.

    What version of 68 Classifieds are you using? Where and why do you need to do this?
  3. awbrys New Member

    Sorry - I realised after I posted it that I was in the wrong forum.

    I'm using the latest version of 68C.

    The 68C site I'm running is unique in that we only offer users one category to post to - Stallions. I’ve created an drop-down extra field called “Breeds” with the following options in the admin section:

    American Saddlebred
    Andalusian
    Appaloosa
    Arabian
    etc

    What I want to do is to dynamically display each of these as links in the footer that directs the user to a page search results that match the Breed they've clicked on. I need to know if there's a way to pull out from the db the list of all breeds.

    Is this possible?
  4. Mike-N-Tosh Owner

    I'm not certain that I understand completely what the goal is. In direct answer to your question, "No". There is nothing built in to do what you are asking.

    Of course that doesn't mean you can't do it, just nothing built in. If it was me, I would simply make a Smarty plugin to do it as it seems that you just want to do a simple single db query on the field options based on the field id. Then you want to output each of those field options as a clickable link that is actually a search query link in the html page
    e.g. <a href="{$smarty.const.url}/searchresults.php?opt[extrafieldid]=option_pulled_from_db">option_pulled_from_db</a>

    Probably in an unordered list or something like that. If you understand php, then have a look at the get_extra_field plugin and that should get you going in the right direction.
  5. awbrys New Member

    Thanks Mike-N-Tosh. I'll have a look at the get_extra_field plugin and see what I can do.

Share This Page