We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 45068
    • 3 Posts
    I'm a newbie to using MODX and I've just added AdvSearch because I would like to use it to create dynamic results pages on my website. I have some experience using Cold Fusion, but have virtually no experience scripting with PHP. Basically what I currently have are static pages on a jewelry website. There are pages with charts for things like Birthstone, Colors, etc. When a particular stone name is clicked it redirects to another static page listing all the jewelry available with that particular gemstone. Since the pages are static they must be individually updated by hand which is a major pain. What I would like to do is use MODX & AdvSearch to build the results page on the fly by sending a query to the database with the name of the gemstone and returning the results to the new page. For an example of my present static setup you can go here: http://www.echomoonjewelry.com/gemstone_colors.html and click on any of the colors to see the static results page that I would like to make dynamic. I'm not looking to use a form where the user needs to input a search term. I was hoping to build the query in to the link. I've read the AdvSearch documentation and while it lists all the individual parameters it assumes you already have a knowledge of scripting & how to build the query, which I do not. Any help would be much appreciated. Thanks!
      • 44985
      • 27 Posts
      Hi,

      I may be misunderstanding your requirements, but it doesn't sound like you even need AdvSearch.

      Is your information in a database at all? If so, try using GetUrlParam. I'll look into my own website and get the code to you in a second. You will need to create a custom snippet which is super simple...as long as you have the database username, password and table name handy. Which I hope you do? (Just never post that stuff on forums though of course tongue)

      Oh..and a very important By-The-Way...if you haven't built your website with a database..none of your pages will be searchable (correct me if I'm wrong someone smiley ). AdvSearch SEARCHES through the database...so you wouldn't even be able to use AdvSearch...methinks..?

      Sar [ed. note: sarahactivated last edited this post 10 years, 8 months ago.]
        ☆ Flag it! - Don't forget to "star" a reply if it's answered your question smiley
        • 44231
        • 126 Posts
        if you are working on custom tables this would be a great help for you
        http://bobsguides.com/custom-db-tables.html

        I'm also a newbie in modx development though I'm sure there's a lot of people here may help just be patients smiley

        I don't know if this might help but I will post it anyway I created a thread regarding advsearch
        http://forums.modx.com/thread/85585/advsearch#dis-post-473100
          • 44985
          • 27 Posts
          Quote from: fullmoonjewel at Sep 11, 2013, 01:42 AM
          Since the pages are static they must be individually updated by hand which is a major pain. What I would like to do is use MODX & AdvSearch to build the results page on the fly by sending a query to the database with the name of the gemstone and returning the results to the new page

          Can you give more information about your website setup? You say that you are using static pages but I see you've got some pagination going on (eg. http://www.echomoonjewelry.com/maincatalog.html#category=necklaces) which makes me think that you are using a database to store all of your jewellery. Can you clarify with me if you ARE using a database? I need a bit more information before I can give you an example snippet you can use.
            ☆ Flag it! - Don't forget to "star" a reply if it's answered your question smiley
            • 45068
            • 3 Posts
            Thank you, everyone, for your swift replies. I had reached my frustration threshold last night when I submitted this post so I probably wasn't all that clear on what I'm trying to do. Yes, Sarah, I am using Cashie Commerce for the shopping cart section of the site. I do, in fact have a database for the jewelry catalog with Cashie and insert the Cashie snippets they provide into the body section of the catalog pages where I want the info displayed. However, as far as I know, Cashie is kind of a standalone thing and I can't use other code to access that particular database outside of the shopping cart function. These other pages that I want to use MODX for are separate from the shopping cart and I have built a custom table under the MODX database for them that contains custom fields for gemstone, birthstone, color, etc. I'm guessing that what I need is a snippet at the top of the results page that queries the database and returns the appropriate results. It's been at least 15 years since I've really done any cold fusion database driven website development and I am sooooo out of the loop when when it comes to things like php & jquery. I feel like an idiot because I know I should be able to wrap my head around this. I guess it's true what they about it being harder to learn new things the older you get smiley
              • 45068
              • 3 Posts
              Thank you johnrobert27. I'm checking out the Bobsguides thing right now.