I need to have a link on a page that contains the current querystring of the page (well two query strings to be exact), how do I do this in XSLT? Basically I want my link on the page to go to "/atestpage.aspx/?querystring1=querystring1value&querystring2=querystring2value&page=pagenumber. I currently have the following
How can I make this link get the querystring value? Just in case you was wondering it is for a search results page that I want to add paging to, I therefore need the "next" link to go to the next page but keep the querystring values that were put in the form.
Now, couple disclaimers... this code is not tested... and others may chose to do it differently. For teaching purposes, i tried to step through with assigning variables and demonstrating a concat... some may chose to do it all in one line.
Hi Chris, thanks for the response, I don't think you fully understand what I am trying to do, this is a search results page so it is showing the results depending on what someone seleted in a form on the previous page, therefore when it creates the page with 10 results for example it needs to have a link to show the next 10 results therefore the link needs to include the querystring results that were submitted with the form.
Hi Bob, thanks for the response that is exactly what I needed, I already have a variable for the querystring so it was just a case of creating a variable for the "thePage". I am now in the process of creating variables for "previousURL" and one to link directly to the page number.
Putting querystring in link on page
Hi,
I need to have a link on a page that contains the current querystring of the page (well two query strings to be exact), how do I do this in XSLT? Basically I want my link on the page to go to "/atestpage.aspx/?querystring1=querystring1value&querystring2=querystring2value&page=pagenumber. I currently have the following
but this just outputs /atestpage.aspx/?location=(umbraco.library:Request('location'))&page=2
How can I make this link get the querystring value? Just in case you was wondering it is for a search results page that I want to add paging to, I therefore need the "next" link to go to the next page but keep the querystring values that were put in the form.
If your paging do you need to pass the page 'location' or just use the current page in which case you can just use the @id.
Here is a great blog post about paging in xslt that might help.
http://www.nibble.be/?p=11
-Chris
it looks as if a concat statement would work best here...
i would set some variables first... just to keep things in order in my mind...
Since you already have a variable for pageNumber, i think we are good there...
then we can make a final variable to tie them all together like this...
then your link statement
Now, couple disclaimers... this code is not tested... and others may chose to do it differently. For teaching purposes, i tried to step through with assigning variables and demonstrating a concat... some may chose to do it all in one line.
Hope this helps.
Hi Chris, thanks for the response, I don't think you fully understand what I am trying to do, this is a search results page so it is showing the results depending on what someone seleted in a form on the previous page, therefore when it creates the page with 10 results for example it needs to have a link to show the next 10 results therefore the link needs to include the querystring results that were submitted with the form.
Hi Bob, thanks for the response that is exactly what I needed, I already have a variable for the querystring so it was just a case of creating a variable for the "thePage". I am now in the process of creating variables for "previousURL" and one to link directly to the page number.
cool! glad it worked and thx for the karma!
is working on a reply...