This question about Missing functionality: Asked

multiple pattern search using STARTSUBST

Hi Lynnwood,

I will try to explain the problem again.

This is how my URL looks like:

Displaying the value of the three variables works fine with:

%URLPARAM{"variable" multiple="on" separator=" | "}% %STOPSUBST% |

But I want to substitute AND display the substitution of all the variables.

Substitute and displaying ONE distinct variable works fine with

| %STARTSUBST{pattern="variable=value1" format="banana" }% 
%URLPARAM{"variable" multiple="on" separator=" | "}% %STOPSUBST% |

Instead of displaying "value1" "banana" is shown.

But what about the other values? How can I substitute them as well?

Hope this helps for understanding my problem.


> Hi Andrea,
> I have used FilterPlugin extensively to format multiple queries but I'm
> not understanding from your example how it fits within a query. Could you
> provide some more context for your question? BTW, this kind of question is
> probably better suited for posting in the Support web. Perhaps you could
> post your question there with some more information and I'll be glad to
> help you figure it out.
> Best regards,
> Lynnwood
> On Dec 6, 2010, at 6:00 AM, Andrea Ramge wrote:
>> Hi,
>> I have a question about the FilterPlugin.
>> I use the STARTSUBST to substitute the query variable
>> |
>> |
>> but I would like to substitute more than one value with other strings.
>> Example:
>> value 1 => banana
>> value 2 => apple
>> value 3 => orange
>> Is there a possibility for this ? Something like:
>> | |
>> Thanks for your help!
>> Andrea

Andrea - What about using %FORMATLIST{}% instead? It seems like this would produce the result you're after:
%FORMATLIST{"%URLPARAM{"variable" multiple="on" separator=", "}%" format="variable=$1" header="| " footer=" |" separator=" | "}%

-- LynnwoodBrown - 06 Dec 2010

Hi Lynwood,

Mmh, I don't see really a difference. Both solutions show a list with the variables and the value they have in the database. Maybe my problem is still not clear. I am able to write a list with all variable values but I am NOT able to substitute every single value with another value (just for displaying). With the STARTSUB stuff I can only substitute ONE variable value. But I have an URL with 4 variables and I want to substitute the value of all 4 variables with 4 different values.

-- AndreaRamge

Andrea - OK, I'm understanding better what you're after although I don't quite understand why you'd need this. One question that might help: where are you getting the list of values that you want substituted for the urlparam values? I can imagine some options to do what you are asking but it starts to get pretty ugly. If we could step back to understand how you end up with these two sets of values that you want to substitute, there might be a more eloquent answer. You're right on one key point, afaik, STARTSUB is designed to only substitute one pattern with another. Another question, is there a direct correlation between the possible URLPARAM values and the values you want to substitute (e.g. that could be stored in a table somewhere)? If that's the case, then you could possibly use EXTRACT (again from the infinitely useful FilterPlugin) to substitute the values.

-- LynnwoodBrown - 06 Dec 2010

OK, I'm understanding better what you're after although I don't quite understand why you'd need this.

I have a database where the values for the variables stored as numbers which should not be shown to the user. And I thought it might be easier for me to substitute the values on the fly in the Foswiki instead of changing the values of the variables in the database directly. I use the combination of STARTSUBST and URLPARAM for the substitution of one variable value which works really fine and easy.

But now I have a topic where the user can make a request to the database with more than one variable (a simple drop down list). In this drop down list the value of the variables (the numbers) in the database are hidden and replaced by a more user friendly word.But after the request the variables taken from the URL parameter are now displayed with there real value (numbers) which doesn't make sense for the user.

-- AndreaRamge - 07 Dec 2010

QuestionForm edit

Subject Missing functionality
Extension FilterPlugin
Version Foswiki 1.0.9
Status Asked
Topic revision: r5 - 07 Dec 2010, AndreaRamge - This page was cached on 14 May 2021 - 09:46.

The copyright of the content on this website is held by the contributing authors, except where stated elsewhere. See Copyright Statement. Creative Commons License    Legal Imprint    Privacy Policy