How to make menu link include a SQL query


(Jon Norris) #1

My site has about 80 pages, all identical apart from a search query to produce the books for that menu item. If each of the 80 menu buttons went to a page, but with the search query actually in the URL link, I would only need one page.
How would I do this?
I think I could set up buttons in forms with hidden inputs but it would be nice to have a cascading menu to save space.


(Dale Levesque) #2

I would definitely take a look at the postswitch stack from Bryn Owen.


(Jon Norris) #3

Wow, I never found that! Thank you so much. I’ve written to him to see if you can pass more than one keyword. Thanks again.


(Dale Levesque) #4

From what I understand, (I just bought it 2 days ago as well) The stack sets a variable called confirmswitch by default, You can alter the PHP flag field to have the stack use a different variable. I think in this way multiple stacks could be included on a page.


(Jon Norris) #5

Bryn has kindly taken the time to ask exactly what I’m doing, and I’ll finish this thread with whatever happens.


(Jon Norris) #6

I’ve now used PostSwitch to pick up the variable and its value that I add to a URL, …and I am still struggling to get a different stack (Stackapps) to use that variable. Though PostSwitch is happy to display according to the variable I need it to work with Stackapps to work with a large database.
Thanks again for your suggestion!