English 中文(简体)
SSI - 只包括文件的一部分吗?
原标题:SSI - Only include part of file?
  • 时间:2012-05-25 11:26:41
  •  标签:
  • html
  • ssi

我有一个文件, 包含了许多我使用 SSI 在网站上展示的新闻和最新消息。 我想做的是让网站其它部分的专栏中 出现这些新闻和最新消息的子集。

我试图在网上搜索,但我不确定这是否可行。我得到的印象是,我需要创建一个包含子集的新文件。我只是觉得这个解决方案并不特别优雅,因为我重复了数据。

有人有什么想法吗?

最佳回答

由于您不能包含文件的一部分, 您有好几个选项 :

  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.
问题回答

您也可以将一个参数传送到文件,并在包含的文件中评估此参数(假设此参数也作为 SSI 页面处理)





相关问题
CSS working only in Firefox

I am trying to create a search text-field like on the Apple website. The HTML looks like this: <div class="frm-search"> <div> <input class="btn" type="image" src="http://www....

image changed but appears the same in browser

I m writing a php script to crop an image. The script overwrites the old image with the new one, but when I reload the page (which is supposed to pickup the new image) I still see the old one. ...

Firefox background image horizontal centering oddity

I am building some basic HTML code for a CMS. One of the page-related options in the CMS is "background image" and "stretch page width / height to background image width / height." so that with large ...

Separator line in ASP.NET

I d like to add a simple separator line in an aspx web form. Does anyone know how? It sounds easy enough, but still I can t manage to find how to do it.. 10x!

热门标签