Tags:
create new tag
, view all tags

Feature Proposal: Formatted search $formfield needs encode option

Motivation

When creating a FormattedSearch I want to be able to use field values in html attributes. However if the field contains a quote or double quote it can break the attribute, effectively truncating it.

Example where this is needed

This formatted search creates a link with a title tag containing $formfield(TopicSummary) that should appear as a tooltip when you hover over the link. The TopicSummary is repeated after the link for reference.

%SEARCH{ "[P]roposedFor" topic="TocNotFoundNoError" web="Codev" casesensitive="on" regex="on" nototal="on" nosearch="on" format="<a href=$quot%SCRIPTURL%/view%SCRIPTSUFFIX%/$web/$topic#foo_$rev$quot title=$quot$formfield(TopicSummary)$quot>$web.$topic</A> Summary: $formfield(TopicSummary)"}%

Codev.TocNotFoundNoError Summary: eliminate %TOC% "error" messages; return blank/empty TOC instead

Description

I'd like an $encodeformfield(name) variable to encode formfields for output. It needn't have the hyphenating or trucating options of $formfield, but an option to remove html tags, or a more general substitution regexp, might be useful (See the example above).

Impact and Available Solutions

Note: Patch is attached as http://twiki.org/p/pub/Codev/FormattedSearchFormfieldEncode/twiki-foo-bar-patch.diff. The patch is against the TWikiAlphaRelease of 15 Feb 2004.

Documentation

If necessary, user documentation of new features introduced by this proposal.

Examples

Example uses of features introduced by proposal.

Implementation

Any comments on how the feature is implemented or could be improved


Discussion:

EncodeParamsForFormFields and FormattedSearchFormTesting may be of help.

-- SamHasler - 05 Feb 2005

Topic revision: r1 - 2005-02-05 - SamHasler
 
  • 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-2017 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.