Gossamer Forum
Home : Products : Gossamer Links : Development, Plugins and Globals :

Re: [Evoir] Random Links Specified Per Category (continued ... )

Quote Reply
Re: [Evoir] Random Links Specified Per Category (continued ... ) In reply to
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.
Subject Author Views Date
Thread Random Links Specified Per Category (continued ... ) Evoir 10695 Dec 26, 2001, 1:15 PM
Thread Re: [Evoir] Random Links Specified Per Category (continued ... )
Paul 10551 Dec 26, 2001, 1:20 PM
Thread Re: [RedRum] Random Links Specified Per Category (continued ... )
Evoir 10488 Dec 26, 2001, 1:23 PM
Thread Re: [Evoir] Random Links Specified Per Category (continued ... )
Paul 10606 Dec 26, 2001, 2:00 PM
Post Re: [RedRum] Random Links Specified Per Category (continued ... )
Evoir 10541 Dec 26, 2001, 2:07 PM
Thread Re: [RedRum] Random Links Specified Per Category (continued ... )
Evoir 10566 Dec 26, 2001, 2:36 PM
Thread Re: [Evoir] Random Links Specified Per Category (continued ... )
DogTags 10650 Dec 27, 2001, 4:59 AM
Post Re: [DogTags] Random Links Specified Per Category (continued ... )
Paul 10540 Dec 27, 2001, 5:20 AM
Thread Re: [DogTags] Random Links Specified Per Category (continued ... )
Alex 10637 Dec 27, 2001, 9:48 AM
Post Re: [Alex] Random Links Specified Per Category (continued ... )
DogTags 10461 Dec 28, 2001, 4:52 AM
Thread Re: [Alex] Random Links Specified Per Category (continued ... )
Evoir 10546 Dec 28, 2001, 12:41 PM
Thread Re: [Evoir] Random Links Specified Per Category (continued ... )
pugdog 10530 Dec 29, 2001, 8:00 AM
Thread Re: [pugdog] Random Links Specified Per Category (continued ... )
Evoir 10526 Dec 29, 2001, 12:49 PM
Thread Re: [Evoir] Random Links Specified Per Category (continued ... )
pugdog 10445 Dec 29, 2001, 2:05 PM
Thread Re: [pugdog] Random Links Specified Per Category (continued ... )
Evoir 10499 Dec 29, 2001, 2:12 PM
Thread Re: [Evoir] Random Links Specified Per Category (continued ... )
pugdog 10461 Dec 29, 2001, 2:16 PM
Post Re: [pugdog] Random Links Specified Per Category (continued ... )
Evoir 10500 Dec 29, 2001, 2:29 PM
Thread Re: [Evoir] Random Links Specified Per Category (continued ... )
Alex 10458 Dec 29, 2001, 2:28 PM
Thread Re: [Alex] Random Links Specified Per Category (continued ... )
Evoir 10469 Dec 29, 2001, 2:43 PM
Thread Re: [Evoir] Random Links Specified Per Category (continued ... )
Alex 10408 Dec 29, 2001, 2:50 PM
Thread Re: [Alex] Random Links Specified Per Category (continued ... )
Evoir 10462 Dec 29, 2001, 3:04 PM
Thread Re: [Evoir] Random Links Specified Per Category (continued ... )
Alex 10472 Dec 29, 2001, 3:23 PM
Post Re: [Alex] Random Links Specified Per Category (continued ... )
Evoir 10354 Dec 29, 2001, 3:36 PM
Post Re: [Alex] Random Links Specified Per Category (continued ... )
DogTags 10459 Dec 29, 2001, 5:17 AM