create new tag
, view all tags

Feature Proposal: URL Parameter Persistence


When clicking on another view such as the printable view, URL parameters that affect the way a page is displayed are not carried over.

Take the WebSearch page for example. Perform a search and then click the "Printable View" and watch what happens. Once on the printable view, try performing a search again and watch what happens again.

Description and Documentation

Need a template variable that lists all URL parameters. It should have the option of excluding or including certain parameters. I imagine that its functionality would be similar to that of the WEBLIST variable.


Example of how this could be used to fix the "printable view" problem:

On the WebSearch page, the "search" parameter is used to perform the search, so it needs to be carried across skins and templates. However, just to be safe, we also want to include all other URL parameters such as the timestamp. To achieve this, we simply print all URL parameters except those that we need in the link. For example, assume we are currently at the URL /WebName/WebSearch?search=green+eggs+and+ham&t=1234. Then all we need to do to correctly link to the printable view is to type the following:

<a href="/WebName/WebSearch?template=viewprint%URLPARAM{exclude="template" template="&$param=$value"}%">Printable View</a>

The resulting URL would be /WebName/WebSearch?template=viewprint&search=green+eggs+and+ham&t=1234.

Impact and Available Solutions

WhatDoesItAffect: Skins, Rendering, Vars, Search, UI


-- Contributors: KevinCraft


I have already implemented passing all URL parameters to printable mode in TWiki 4.1.

-- ThomasWeigert - 05 Jan 2007

I have the latest TWiki installed and I don't see anything in the pattern template file that carries over URL parameters, nor does it actually work when I click on printable view. The search page still fails as in my example above. Where have you implemented this?

This functionality is needed for more than just the printable mode. The Raw View is another example. A user might click on "Raw View" and then click on the regular view again. If the parameter is not carried over then the page will not display correctly.

I think the best solution is to just provide a template variable like I am suggesting. It is too difficult to try to predict every situation in which the URL parameters will need to be carried over.

-- KevinCraft - 09 Jan 2007

URL parameter stickyness does not make sense for the raw view, as it does not render the contents of the page, but displays the literal text.

Try this: Go to http://develop.twiki.org/~twiki4/cgi-bin/view/Bugs/WebSearch?search=HTML_equal&scope=text and then click on printable. As you can easily observe, the URL parameters are preserved.

I don't think you are working of a Twiki 4.1 installation, as you are using an outdated way of invoking the printable view. You should use ?cover=print.

-- ThomasWeigert - 09 Jan 2007

You are correct, it doesn't make sense for the raw view, but if you then go back to the regular view from the raw view then you will lose the URL parameters. The only way to correct this problem is to carry them through to the raw view.

I upgraded to the latest TWiki via the upgrade scripts. The template file viewtopicactionbuttons.pattern.tmpl contains the "cover" URL parameter when linking to the printable view, but when I actually look at the printable view link in the browser, it appears with the "template=viewprint" parameter rather than "cover=print". I am not sure why this is happening.

-- KevinCraft - 09 Jan 2007

It could also be argued that links to previous revisions (next to the History link) should also carry over the URL parameters.

The Attach link may need to be handled in a similar way as the Raw View link, too. URL parameters won't affect the attach page itself, but will affect the view page when the user returns to it.

Perhaps Edit and WYSIWYG should be considered, as well.

-- KevinCraft - 09 Jan 2007

Kevin, first I don't understand your use cases. E.g., what do you mean by "go back to the regular view from the raw view". How do you do that? If you go back in the browser, you will get the URL parameters. Otherwise, there is no "back to the previous view mode" button, at least not in the standard installation.

Also, can you advise which version of TWiki you are running. If you installed it and you have a messed up printable view, there is a bug in the installation. Please advise what version you have and what install process you followed.

-- ThomasWeigert - 10 Jan 2007

Here are the exact steps for the use case I am talking about:

  1. Go to a WebSearch topic and search for something
  2. Click the "Raw View" link at the bottom
  3. Click the "View Topic" link at the bottom

Notice that the search parameter has been lost.

Regarding my installation, I am on version 4.0.5. I upgraded from 4.0.0 to 4.0.3, 4.0.4, then 4.0.5. Unfortunately, I could not find any files to upgrade to 4.0.1 and 4.0.2 before upgrading to 4.0.3, so I just hoped that the fixes would be included in 4.0.3, 4.0.4 or 4.0.5. I guess they weren't. I see where I can find the files, now. Would it be safe to start over and apply patches 4.0.1-4.0.5 as long as I use the zip files rather than the patch utility?

-- KevinCraft - 10 Jan 2007

I just created a separate installation from scratch - a full install of 4.0.5. The original use case I mentioned (the WebSearch problem) has not been corrected. I have not modified anything and I am using the Pattern skin.

-- KevinCraft - 10 Jan 2007

Parameter persistence for printable view is only available in TWiki 4.1, not on TWiki 4.0.5.

-- ThomasWeigert - 11 Jan 2007

I have verified that the sequence "view raw" -> "view topic" looses the parameters.

I suggest that we

  • generate a list of other such scenarios and
  • decide whether these are defects or not.

For example, with respect to raw mode, one could argue that (i) the raw mode shows the text of the topic unrendered and therefore should ignore any URL parameters and (ii) going to view topic renders the topic literally shown in raw mode and should therefore not depend on any URL parameters but show the topic in its pure rendered form.

Having a more exhaustive list of such issues will allow us to make a consistent decision. This is tracked in Bugs:Item3432.

I don't think there should be a user construct such as the one suggested above to handle this situation.

-- ThomasWeigert - 11 Jan 2007

Ah, 4.1, not 4.0.1. I am guessing that 4.1 has not been released yet.

Thanks for the feedback & discussion...

-- KevinCraft - 11 Jan 2007

Edit | Attach | Watch | Print version | History: r10 < r9 < r8 < r7 < r6 | Backlinks | Raw View | Raw edit | More topic actions
Topic revision: r10 - 2007-01-11 - KevinCraft
  • 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-2018 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.