Tags:
create new tag
view all tags

SID-00033: The -literal- tag for in-line html code problem in WYSIWYG

Status: Answered Answered TWiki version: 4.2.0 Perl version:
Category: WysiwygPlugin Server OS: MS 2003 Last update: 17 years ago

In raw edit mode I have made a hyperlink to another program, which includes characters or code that Twiki has problems with so I use the <literal> tag to prevent Twiki from touching it. This works fine in raw edit, but using the WYSIWYG editor to edit the existing page ruins the link.

Ultimately I want to add this link to a template, however creating a new topic from a template always starts with the WYSIWYG editor and this therefore ruins the link.

This is the (simple version of the) link

<a href="<literal>http://xxx.com/default.asp?saction=P-US20070007177" target="_blank" </literal>>US20070007177</a>

And this is the result from WYSIWYG as soon as you open it for edit.

<a href="&#65533;literal0&#65533;>US20070007177</a>

In the final template I want to use part of the topic name to add to the link, which looks like this (and works outside the template)

 <a href="<literal>http://xxx.com/default.asp?saction=P-</literal>%CALC{ "$REPLACE(%TOPIC%, 1, 6,)" }%<literal>" target="_blank" </literal>>%CALC{ "$REPLACE(%TOPIC%, 1, 6,)" }%</a> 

Does anybody know a way around thisproblem?

-- JurriaanHehenkamp - 14 Jan 2009

Discussion and Answer

I just came across the -sticky- tags, I'll try that before asking further.

-- JurriaanHehenkamp - 14 Jan 2009

The "sticky" tag could do it. Place it around the "a" tag, not inside.

-- PeterThoeny - 14 Jan 2009

The "sticky" tag doesn't seem to help:

<sticky><a href="<literal>http://temp.com/default.asp?saction=P-</literal>%CALC{ "$REPLACE(%TOPIC%, 1, 6,)" }%<literal>" target="_blank" </literal>>%CALC{ "$REPLACE(%TOPIC%, 1, 6,)" }%</a> </sticky>
Results in the same mangled text in the WYSIWYG:
<a href="&#65533;literal0&#65533;%CALC{ "$REPLACE(%TOPIC%, 1, 6,)" }%&#65533;literal1&#65533;>%CALC{ "$REPLACE(%TOPIC%, 1, 6,)" }%</a> 
I guess I have to find a way to get the html string (well formed) fully inside the literal tags, this seems to work. The question is then how to get (part of) the topic name inside the string (in place of the CALC formula) to make it useful in the template. Anything else I can try?

-- JurriaanHehenkamp - 15 Jan 2009

Don't use the sticky and literal, try using just the sticky. Untested:

<sticky>
<a href="http://temp.com/default.asp?saction=P-%CALC{ "$REPLACE(%TOPIC%, 1, 6,)" }%" target="_blank">%CALC{ "$REPLACE(%TOPIC%, 1, 6,)" }%</a>
</sticky>

Here is another idea: Use a simple INCLUDE or a ParameterizedIncludes that shows the link, such as (untested):

%INCLUDE{DateLink}%
With this DateLink page content:
<a href="http://temp.com/default.asp?saction=P-%CALC{ "$REPLACE(%INCLUDINGTOPIC%, 1, 6,)" }%" target="_blank">%CALC{ "$REPLACE(%INCLUDINGTOPIC%, 1, 6,)" }%</a>

-- PeterThoeny - 15 Jan 2009

Thanks Peter! The <sticky> only works perfectly. I therefore didn't try the Include option yet.

-- JurriaanHehenkamp - 19 Jan 2009

      Change status to:
ALERT! If you answer a question - or someone answered one of your questions - please remember to edit the page and set the status to answered. The status selector is below the edit box.
SupportForm
Status Answered
Title The -literal- tag for in-line html code problem in WYSIWYG
SupportCategory WysiwygPlugin
TWiki version 4.2.0
Server OS MS 2003
Web server Apache
Perl version

Edit | Attach | Watch | Print version | History: r7 < r6 < r5 < r4 < r3 | Backlinks | Raw View | Raw edit | More topic actions
Topic revision: r7 - 2009-01-19 - PeterThoeny
 
  • Learn about TWiki  
  • Download TWiki
This site is powered by the TWiki collaboration platform Powered by Perl Hosted by OICcam.com Ideas, requests, problems regarding TWiki? Send feedback. Ask community in the support forum.
Copyright © 1999-2026 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.