Drop down menus

Discussion in 'Pre Sales Questions' started by Dragline, Jan 27, 2011.

  1. Dragline Customer

    Been exploring the live demo. I really like what I see. My site would have a handful of main categories and numerous sub categories and even sub sub categories. How hard would it be upon searching or placing an ad to have the drop down box only show the main categories, then after one is selected in another drop down menu its sub categories are shown, etc.. I would be willing to pay someone for the modification if need be. I just want to make sure it can be done.

    Thanks
  2. Blair Administrator

    Version 5 includes a new templating feature that we'll call "68 tags". It's pretty darn cool (please excuse my immodesty!).

    Here's a page in the documentation that explains how the category list is called from within a theme file:
    Theme Tag - categories list | 68 Classifieds Documentation
  3. bowers01 Genius At Work

  4. Blair Administrator

    The categories list theme tag is meant to offer an easy means of building a category tree.

    I'm sorry, Nick, I don't see any categories on your homepage. Are you referring to your "Popular Links" section? I don't see why you couldn't use the theme tag to do something similar.
  5. Mike-N-Tosh Developer & Moderator

    @Blair I believe Nick is referring to the search, which once a parent category is selected, then activates a sub menu pulldown based on the parent category selection.

    @Nick This ability isn't within the capability of php as php in of itself cannot inject (X)html into a rendered page. This is done with the javascript (AJAX). Bearing this mind, this could be done with any php script and javascript. It is a matter of the javascript capturing the event (e.g. selecting a category) and then triggering a method/function in another php script which returns data back to the javascript which in turn injects the code (returned data) into the page.

    This is the difference in the technology of the programming language. php is a server side language. javascript is a client side language. The computer gets the javascript code and it runs on the clients computer, not much different then when you open a program that's on your hard drive. The client computer never sees or gets any of the php code, it stays on the server and is only run by the server.
  6. bowers01 Genius At Work

    thanks Mike, looks like i am staying on v4 for a bit longer
  7. Mike-N-Tosh Developer & Moderator

    Nick,

    It seems that you are misunderstanding what I posted. What you are doing on your current site is being done by the javascript that you have linked to in the head of the layout file. That same javascript could be applied in v5 as well, but the php script (ajax.php) that the javascript calls after the category is selected would simply need to be changed to run the mySQL query the way that v5 does.

    On the flip side, v5 is still a beta product, so I wouldn't recommend using it for a live production site. I would say that there shouldn't be anything stopping you from developing a BETA version of the site with v5.

    As I know from the forum history, that you run a localhost development environment, you might consider developing a copy of your site on your localhost with v5.

    I am actually working on something very similar to this in v5 myself for my upcoming v5 template offering. Although not exactly the same thing as I'm not creating a "Quick Search", I am listing the parent categories in a menu and want to use javascript to show the subcategories within the menu in accordion style upon clicking an icon beside the parent category.

    You can PM me if you'd like a preview look.
  8. bowers01 Genius At Work

    Ah thank you Mike, never thought to actually do it without a module, and figured the javascript would need major changes to make it work.
    Will have to have a play with it.

    Cheers,
    Nick
  9. Dragline Customer

    Thats exactly what I am wanting to do. I just don't want a drop down menu with parent categories along with sub categories and sub sub categories all in the same box. Thats how it is in the 68 classifieds demo.
  10. Blair Administrator

    Sorry - I should've extended my comment....

    What I failed to include was that the module creates an html snippet but with some modification, could probably create a javascript snippet that can be used the way you describe.

Share This Page