Hi,
You need to get a firm understanding of SSI, CGI and HTML pages to understand what is going on why.
Consider:
1. When you run Build All, the program generates a single html page for every category. Links SQL takes your category.html template, parses it with information about the category, and then saves the output as an html page. Now, when people view this page, they are viewing a static html page, the page does not get parsed again by Links SQL, so any template tags are useless (and will have already been removed).
2. However, if you have SSI turned on, then Apache will parse the page and run any commands it finds.
See the problem? You have <%set CategoryID = 5%>, however this is only used by Links SQL, and only evaluated once when the pages are built. Apache does not see this at all.
3. Now CGI generated pages are a bit different, Apache does not parse the output of CGI, so you can not use SSI on them. That's why <!--#include ...--> won't work on the search_results template, but would on the category.html template.
As to your question, what you want to do is pass CategoryID into the SSI call. So you want your parsed page to contain:
<!--#include virtual="/page.cgi?p=random&CategoryID=5"-->
To do that you can either hard code the number in, or if you want it different for each category, use a template variable (as then each category page that gets built will have a different ssi command).
Hope that helps,
Alex
--
Gossamer Threads Inc.
You need to get a firm understanding of SSI, CGI and HTML pages to understand what is going on why.
Consider:
1. When you run Build All, the program generates a single html page for every category. Links SQL takes your category.html template, parses it with information about the category, and then saves the output as an html page. Now, when people view this page, they are viewing a static html page, the page does not get parsed again by Links SQL, so any template tags are useless (and will have already been removed).
2. However, if you have SSI turned on, then Apache will parse the page and run any commands it finds.
See the problem? You have <%set CategoryID = 5%>, however this is only used by Links SQL, and only evaluated once when the pages are built. Apache does not see this at all.
3. Now CGI generated pages are a bit different, Apache does not parse the output of CGI, so you can not use SSI on them. That's why <!--#include ...--> won't work on the search_results template, but would on the category.html template.
As to your question, what you want to do is pass CategoryID into the SSI call. So you want your parsed page to contain:
<!--#include virtual="/page.cgi?p=random&CategoryID=5"-->
To do that you can either hard code the number in, or if you want it different for each category, use a template variable (as then each category page that gets built will have a different ssi command).
Hope that helps,
Alex
--
Gossamer Threads Inc.