This seems to be a basic stuff, but I cant't find the answer. I need to modify the content of a specific page if it is entered from another specific page. Seems that you accomplish that by adding urlparam to the {cms_selflink} on the originating page and check for the existence of that parameter on the destination page with {if $smarty.get.myparamhere}. Well, it doesn't work for me. My selflink tag looks like the one below:
{cms_selflink page="page-alias" text="Back" urlparam="&myparam=1"}
The url used by the browser is:
http://www.mywebsite.com/index.php/page-alias&myparam=1
and the browser shows error 404.
I should have mentioned that pretty urls are turned on for this site, but I never found the indication, that pretty urls don't like urlparam.
I disabled the pretty urls to move on with this, but, if posible, I would like to have them on and parse the parameters between pages using GET method. Is that possible? If so, how?
urlparam and pretty urls
Re: urlparam and pretty urls
Your first parameter needs to come after a question mark and not an ampersand (&).
Cheers!
Cheers!
CMSMS Made
Re: urlparam and pretty urls
Thanks for the response, WebGuy. The first parameter is "page-alias", which in pretty urls comes after index.php/. I don't think the question mark is used when pretty urls are turned on.
It just seems like with pretty urls you can parse only one parameter using GET method and it is the page alias. I would love if one of developers indicated whether I'm right or wrong.
BTW, in the process of experimenting with different syntax I tried
http://www.mywebsite.com/index.php/page-alias?myparam=1
but that gave me 404 as well.
It just seems like with pretty urls you can parse only one parameter using GET method and it is the page alias. I would love if one of developers indicated whether I'm right or wrong.
BTW, in the process of experimenting with different syntax I tried
http://www.mywebsite.com/index.php/page-alias?myparam=1
but that gave me 404 as well.
Re: urlparam and pretty urls
You have to change your rewrite code to fetch the variable if that's what you are trying to do.
Try changing
RewriteRule ^(.+)$ index.php?page=$1 [QSA]
to
RewriteRule ^(.+)&(.+)$ index.php?page=$1¶m=$2 [QSA]
Try changing
RewriteRule ^(.+)$ index.php?page=$1 [QSA]
to
RewriteRule ^(.+)&(.+)$ index.php?page=$1¶m=$2 [QSA]
CMSMS Made
Re: urlparam and pretty urls
what's happening is you are doing the url
pagename¶meter=2
but the server is doing
index.php?page=pagename¶meter=2
Which it can't find cause it doesn't exist.
Cheers,
pagename¶meter=2
but the server is doing
index.php?page=pagename¶meter=2
Which it can't find cause it doesn't exist.
Cheers,
CMSMS Made
Re: urlparam and pretty urls
sorry I gave you bad code, isn't hard to explain. I don't want to mess it up if someone else can explain this better, if not I'll be happy to help.
Take care.
Take care.
CMSMS Made