
Luke
Staff
/ Moderator

Sep 16, 2002, 5:13 PM
Post #2 of 3
(2117 views)
Shortcut
|
|
Re: [MalaK_3araby] Saved search & Category pulldown list
[In reply to]
|
Can't Post
|
|
Hi Malak, Thanks for your post. How can i save predfined search criteria? Here's how I usually do it. I perform a regular search from the search form. When my search results come up I click the "next" button which takes be to the next page or articles (you'll now notice that your browsers address bar is now populated with a query string). To get the first set of results I click the "prev" button so I'm back where I started. Here's an example of what the search results URL will look like: http://www.yourwebsite.com/artman/exec/search.cgi?cat=4&start=1&perpage=5&template=search/search_results_column.html If I want to create a direct link I just copy and paste the URL from my browsers address bar and add it to a hyper link tag (<a href="Paste URL here">). You can use a virtual include to include your search results into another page. e.g. <!--#include virtual="/artman/exec/search.cgi?cat=4&start=6&perpage=5&template=search/search_results_column.html"> Please note that not all web servers allow you to pass query strings using a Virtual Include. I tested this example on a Windows IIS server and Apache. Unfortunately it didn't work on Windows IIS, but it works fine using using an Apache server. i am trying to include a pulldown category list ($category_pulldown$) in the body of article page, but all i am getting is the "All Categories" option. I looked at the search_form and included the html from there but its not working .. what am i missing? Unfortunately the $category_pulldown$ placeholder is not recognized by the /article/default.html template file so you won't be able to use it in your published articles. What you can do instead is hard code your category pulldown. The easiest way to do this would be to go to your advanced search page (search.cgi) through a web browser, view the source code and copy and paste the source code of the category pulldown. e.g. <select name="cat" style="font-size: 10px; letter-spacing: -0.05em"> <option>Entire Site</option> <option value="2">National News <option value="3">World News <option value="1">Business <option value="4">Sports <option value="5">Entertainment </select> You can then include this HTML code into your /article/default.html template file. Or course, one of the drawbacks is every time you add or remove a category you'll have to manually update this file. I hope this helps. :) Luke Holzken Product Development
|