Fog Creek Software
Discussion Board




Knowledge Base
Documentation
Terry's Tips
Darren's Tips

{$ include "PTMFOG0000004045" $} ?

Can someone please enlighten me why this: {$ include "PTMFOG0000004045" $} doesn't work?

Rogn

Rognvaldr
Thursday, June 17, 2004

It only seems to work for me when I use the full path in stead of the magic name.

Rogn

Rognvaldr
Thursday, June 17, 2004

Rogn

Don't use the magic name use an article name.

From the Help File:
Topic: Including One Article Inside Another
The include statement is replaced with the body of any article.

It take a bit of 'getting your head around it' but the Include statement returns the body of and article where the magic name will be parsed to a path. Hmm, I'm not doing so well here ... :)

Use the article name - it'll work.

Perpetual Newbie II
Thursday, June 17, 2004

Yes you need to use the article name.  It seems like the magic name "ought" to work, for the sake of consistancy.  I don't find it to be a huge problem however.

I use {$ include pretty extensively in my templates.

Ken McKinney
Thursday, June 17, 2004

Rogn

You use magic names where you want the link/path to a published object (picture, article ...) inserted into your HTML to remain valid regardless of where the item is located in your project - even if you move the item around. They're not for use in CD script.

Using {$ Include 'name" $}
is the same as writing out:
{$ foreach x in (filename "name") $}
  {$ x.body $}
{$ next $}
There's a caveat or two with the use of Include (as well)  that makes reading about it in the help file worth the time.

GL
PNII

Perpetual Newbie II
Thursday, June 17, 2004

Thanks guys! I did read the help file, but I obviously misinterpreted the explanation.

Rogn

Rognvaldr
Friday, June 18, 2004

Rogn

Actually, reading up on both the Include and MagicName items in the help file (so that I could answer your question with some certainty) I found that my understanding of what I read was kind of hard to present ... in any sort of logical manner. I'm sure my conclusions came primarily from interpretation ~ I didn't find the help file all that clear in this instance.

Hey, it was a fun break :)
PNII

Perpetual Newbie II
Friday, June 18, 2004

*  Recent Topics

*  Fog Creek Home