user843337
user843337

Reputation:

SSI - Only include part of file?

I have a file which contains a lot of news & updates that I display on my website using SSI. What I would like to do is to have a subset of these news and updates that appear in a column elsewhere in the website.

I have tried looking around online, however I'm not sure if this is even possible. I get the impression that I'd need to create a new file that contains the subset. I just feel this solution isn't particularly elegant since I'm duplicating data.

Does anyone have any ideas?

Upvotes: 1

Views: 246

Answers (2)

Paul
Paul

Reputation: 31

you could also pass a parameter to the file and evaluate this parameter in the included file (assuming this is treated as a SSI page as well)

Upvotes: 1

John Conde
John Conde

Reputation: 219894

Since you can't include part of a file you have a couple of options:

  1. Separate the file into two parts and include both when you need both, and only one when you only need that one part
  2. Separate the file into two parts and create a third SSI which includes both. Then on the pages where you need both you can include just the one file that includes both for you.

Upvotes: 1

Related Questions