Fog Creek Software
Discussion Board




Knowledge Base
Documentation
Terry's Tips
Darren's Tips

Quotation marks

I am struggling with quotation marks. Since I have used some quotes in the teasers which in general, I want to use in the template as metatags.

My html:
<HEAD>
<META name="keywords" content="{$.keywords$}">
<META name="description" content="{$.teaser$}">
<TITLE>{$.headline$}</TITLE>
<LINK REL=StyleSheet HREF="PTMFOG0000000103.css" TYPE="text/css">
</HEAD>

When the teaser looks like
"hi, this is a quote" by someone

then the generated HTML becomes invalid like:
<META name="description" content=""hi, this is a quote" by someone">
par of which will be displayed by IE6 at the top of the browser window.

In this case, the " should be replaced by &qout

Please, please, provide some CityScript functions to enforce this kind of behavior!

I have tried to copy &qout; into the teaser field, but this is automatically replaced into " by the DHTML component.

Any work arounds known?

Adriaan van den Brand
Monday, April 22, 2002

Have you tried putting the tag related values in single quotes instead of double quotes? For example:

content='{$.keywords$}'

I know that single quotes are a valid substitute and I use them all the time when I might have double quotes in my value string. However, I don't know what happens to your double quotes when used within a Meta tag.

Stu
Monday, April 22, 2002

Right now I've used a dirty work around: I've substituted all double quotes in my text for '' (that is two single quotes).

Using single quotes is not much of an option since they occur quite often as well.

Adriaan van den Brand
Monday, April 22, 2002

Can't you use the HTML entities for right and left double quotes: &rdquo; and &ldquo;

These should be put outside the CD script braces

Joel Goldstick
Monday, April 22, 2002

Or if the quotes are always surounding the teaser, why not leave them out of the teaser text and just put them in the html where the .teaser piece is inserted in your template

Joel Goldstick
Monday, April 22, 2002

I agree that this is a bug, we'll fix it in the next service pack. I can't think of any good workaround for now other than using two single quotes '' when you need a double quote in the teaser, but I admit this isn't a good workaround.

Joel Spolsky
Monday, April 22, 2002

I didn't mention the word bug.... may be more a badly missing feature ...  Previously I and others have asked for some filter (like encode html). This would do the trick also in this case.  Somethink like

<META name="description" content="{$encode .teaser$}">

I guess that would be the neatest way and also solve other similar issues.

(and if we can also get a filter like {$remove_tags var $} it would be great!)

Adriaan van den Brand
Monday, April 22, 2002

Learn more about Metatags
@ http://discuss.fogcreek.com/CityDesk/default.asp?cmd=show&ixPost=3942&ixReplies=2

Bob (RJ) Burkhart
Sunday, August 25, 2002

*  Recent Topics

*  Fog Creek Home