Tags:
create new tag
view all tags

SID-00714: Custom topic variables not correctly parsed

Status: Answered Answered TWiki version: 4.3.2 Perl version: 5.10
Category: CategoryEditing Server OS: Ubuntu 9.10 Last update: 15 years ago

Hello everyone,

I just started to use TWiki an I am very happy with it. However, I run into problems that boils down that I do not know use dynamic topic variables that were created using a plugin correctly.

What I do is to create a topic variable from a database query using the DatabasePlugin like this:

   * Set GENEID = %DATABASE_SQL{description="SynWiki" sql="SELECT id FROM all_genes WHERE wiki_name = %TOPIC%" format="$id"}% 

This call fills the GENEID variable with a name, lets say "GeneX". I now represent the value of GENEID like this:

%GENEID% 

all works well and it displays "GeneX". If I, however, use the GENEID variable in another variable such as:

%MAKETEXT{%GENEID%}% 

it does not display "GeneX", but part of the DatabasePlugin call. It shows

%DATABASE_SQL{description="SynWiki 

Could anyone explain to me how to solve this? Any help is greatly appreciated.

Pim van Nierop

-- PimVanNierop - 2010-01-13

Discussion and Answer

%MAKETEXT% cannot handle variable text. You need to pass variable text as an argument, such as:
%MAKETEXT{"Gene ID is: [_1]" args="%GENEID%"}%.

-- PeterThoeny - 2010-01-15



Thanks for formatting my support question. I followed you advise by including the following in my page:

%MAKETEXT{string="[_1]" args="%GENEID%"}%
or
%MAKETEXT{"[_1]" args="%GENEID%"}%

This in both cases results in:

%DATABASE_SQL{description=

I also tried the following (this is what I am really after, the MAKETEXT is just an example that displays the same problem):

[[%ENCODE{"http://www.ncbi.nlm.nih.gov/sites/entrez?Db=gene&term=%GENEID%[gene]"}%][Entrez link]]

This results in a hyperlink that is correctly named "Entrez link", but has a URL like this:

http://www.ncbi.nlm.nih.gov/sites/entrez%3fDb%3dgene%26term%3d%25DATABASE_SQL%7Bdescription%3d%22SynWiki

The problem does not go away so easily I am affraid. Somehow the local variable does not seem to be replaced by the actual result of the database query. Again, thanks for the assistance.

-- PimVanNierop - 2010-01-15

Sorry for bumping this topic, but I really would like to know of a solution. What feature of TWiki am I overlooking here?

-- PimVanNierop - 2010-02-07

Christ! Is this support site inactive or what?! Time to switch to a fork?

-- PimVanNierop - 2010-02-24

Open source is about taking and giving back. I invite you to get involved with the TWiki community. The more you help out, the more you will get help from the community.

I invite you to get involved with the TWiki community. As a contributor you can actively make a difference and help shape the product. A good way to get engaged is to participate in the biweekly release meetings. The next one is Monday 2010-03-01, HelsinkiReleaseMeeting2010x03x01. To get started on specific areas please visit:

-- PeterThoeny - 2010-02-24

BTW, you do not need to use MAKETEXT unless you need text displayed in multiple languages.

-- PeterThoeny - 2010-02-24

Closing this question after more than 30 days of inactivity. Feel free to reopen if needed. Consider engaging one of the TWiki consultants if you need timely help. We invite you to get involved with the community, it is more likely you get community support if you support the open source project!

-- PeterThoeny - 2010-04-05

      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 Custom topic variables not correctly parsed
SupportCategory CategoryEditing
TWiki version 4.3.2
Server OS Ubuntu 9.10
Web server Apache2
Perl version 5.10
Edit | Attach | Watch | Print version | History: r7 < r6 < r5 < r4 < r3 | Backlinks | Raw View | Raw edit | More topic actions
Topic revision: r7 - 2010-04-05 - 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.