include file in include file

include file in include file

am 12.11.2007 08:39:39 von Pasi Mustalaht

is there a way to make include file contain [A] another call for an
include file [B] ? Or is there any other trick to reach the same aim.

in the page there is a call like this for [A]:


My page includes a file containing a list of pictures and their
descriptive texts. Now I have written the text in the file [A] even
though I have the texts in separated files. So I have the texts in two
copies in the same directory.

I marked the place for the include file [B] with 'XXXXXXXXXXXXXXXX':
-------------






P1030368.JPGXXXXXXXXXXXXXXXX

href="/~documents/pictures/cfx-editor.shtml?/~documents/pict ures/2007/Pasi/DOC.cfx/P1030368.JPG.txt"
onclick="return popup(this, 'notes')">
EDIT
,



--------------

ps: I know that the paths included are long, but I have not optimized
that part yet.
Unfortunately these pages are in a closed network and can not be seen.

Re: include file in include file

am 12.11.2007 11:13:53 von Andy Dingley

On 12 Nov, 07:39, PTM wrote:
> is there a way to make include file contain [A] another call for an
> include file [B] ?

Yes. Simple SSI won't, but many of the "programming language based"
include mechanisms will support this.

> Or is there any other trick to reach the same aim.

Generally think about just what it is you're trying to do logically
with your data, then do as close to that as you can, in terms of
implemented code. "Includes" are a pretty blunt tool, especially at
the level of what are fragments of output-ready HTML. If you're
working with a programming language instead though, this is very easy.
In particular, an example of repeated elements where you had to
read matching pairs of data elements for the image URL and the alt
attribute would be impractical by includes, easy with language
variable.