Fog Creek Software
Discussion Board




Knowledge Base
Documentation
Terry's Tips
Darren's Tips

Suppressing the Link from Teaser

From the docs: "For each article, using the article editor, surround the part of the field that you want to be a link with [[ and ]]."

Is there a way to suppress this behavior in certain places? I want to show the teaser of my recent blog entry on my home page, but link to the blog page, not the individual archive item (which is what the [[link]] gives me).

I could just strip the [[ ]] while the item is on the home page, but it would be cool to have this happen automagically so I don't have to go back and edit the teaser when the item is moved to the archives. I want that [[link]] on the archives page.

Suggestions? CityScript? Preference? PHP Code? S.O.L.?

(I hope this is not a repeat question. I tried to search, but you can imagine the hits I got with things like "teaser", "link" and several other searches).

Thanks in advance!

Phillip Harrington
Wednesday, July 09, 2003

Would this work:

Outer foreach  x loop which specifies the index file only
Inner foreach y loop which gets the articles
code which places the article names {$y.name$} and
the link {$x.link$} into your code
 

Joel Goldstick
Wednesday, July 09, 2003

Can you do nested loops in CityScript?

David Burch
Wednesday, July 09, 2003

sometimes you can

Joel Goldstick
Wednesday, July 09, 2003

I tried this, and it doesn't work, because {$ y.teaser $} still has it's link to the archive page. I want the teaser with no link. Thanks though! Anyone else?

Phillip Harrington
Thursday, July 10, 2003

Ok, simpler.  This is the code from my website on
http://www.columbuswebmakers.com/webservices/index.html

The first loop is the normal situation where the linke relates to the x.info following.  The second loop looks the same on the page, but the links all go to one specific page.  In this case, the page is this same example page. 

To get a magic name, right click on the article and select copy magic name

is this what you need?


<ul>
{$foreach x in (and (not (thisArticle))(thisFolder))$}
<li><A href="{$x.link$}">{$x.headline$}</A> {$x.filedDate$} {$x.teaser$}</li>
{$next$}
</ul>

<p>This little bunch of code lists the headline, filedDate and teaser of each file, but the links all go to the present page.  </p>
<ul>
{$foreach x in (and (not (thisArticle))(thisFolder))$}
<li><A href="PTMFOG0000000023">{$x.headline$}</A> {$x.filedDate$} {$x.teaser$}</li>
{$next$}
</ul>

Joel Goldstick
Thursday, July 10, 2003

*  Recent Topics

*  Fog Creek Home