Server Side Includes

Andy_Potvin

Registered
Good Day,
Those of you who have experience with SSI, are you aware of any method of instructing the "server" to include only a portion of a file.
Example:
Document A has sections
A
B
C

I would like Section B included in another served page Z and Section A include on yet another served page X.

My current method is to segment Document A into
Document A_A
Document A_B
Document A_C
each containing the unique information to be included.
Thanks for any toughts and ideas in advance
Andy
 
from what I understand you cant do this.... SSI's are very static.....even PHP includes cannot get variables passed to them (as of 4.3) in tems of include(yourfile?var=value) but this may be a new feature....anyone?
 
Nope. Can't do it like that. For that type of partial stuff, use HttpXmlResponse model or some javascript or something along those lines.
 
...but you CAN have nested includes... So you can have fragments A, B & C, and then an AB include, a BC include, etc...

So the include you'd use in your page is ether AB or BC, that way you still have your "B" content only in one place and not duplicated twice.

Also you can do some conditional logic... Check out the Flow Control Elements.



Did I answer the wrong question?
 
All of your responses have been useful and have in fact guided me to the conclusion that - That an easy solution (onestep) to my situation probably does not exist on the SSI path. To clarify a bit further, a particular piece of software I use to schedule Little League games outputs html which I use on the leagues webs site. In general the output suits our purposes, however the "page" that the software outputs containing the game results has not only the results of the played games but the standings of each team in the division. The league has historically posted that information uniquely in two different locations. In order for segregate the information I must (by hand) take the genrated page, duplicate it, remove the play results from one version leaving behind the standings and invert the procedure for the other document. The resulting documents are "included" in the standings and scores pages on the web site. For one document this is not a big deal 5 minutes of effort. For eight divisions of information this gets to be cumbersome task. I was hoping to have the server somehow parse the unified page and segment the infomation for me.
For now I will do it by hand , and continue to look around for a solution , unless the season ends before I can solve the issue.
Thanks for All your help.
Best Regards
Andy Potvin
 
Write a PHP script that reads in the file, but parses it and display's only the part you care about.

The PHP's for game scores and standings would only show the corresponding parts.

That way you can continue to use your sofware to output it's page the same way.

To learn more, read about some of PHP's string search/replace functions.
 
Back
Top