|
Smarty
WARNING: All discussion is moving to https://reddit.com/r/smarty, please go there! This forum will be closing soon. |
|
View previous topic :: View next topic |
Author |
Message |
blackhawkmx Smarty Regular
Joined: 20 May 2005 Posts: 76
|
Posted: Thu Nov 20, 2008 5:30 pm Post subject: help with outfilters |
|
|
Is it possible to use an outputfilter to mask a url name in the status bar and also in the properties window when clicked on? for example take something like...
Code: |
http://mysite.com/item.php?page=one
|
and mask it to..
Code: |
http://mysite.com/one
|
I have a bases to work from....
Code: |
function changelink($output, &$page)
{
return str_replace('item.php?page=', '', $output);
}
$page->register_outputfilter('changelink');
|
but I don't want to use str_replace because obviously that will not direct me to the right page in my situation. I simply want to mask the url name - sorta like a replacement name.
thanks for the help _________________ Bring it back to basics. You and I can make it right! |
|
Back to top |
|
frode Smarty n00b
Joined: 21 Nov 2008 Posts: 4
|
Posted: Fri Nov 21, 2008 2:42 pm Post subject: |
|
|
Well, if I understood your question correctly and you're willing to use javascript, you could simply point the links to mysitedotcom/one and have an onclick event set window.location to mysitedotcom/item.php?page=one. That way the link/status/properties would appear to send you to mysitedotcom/one, but in reality take you to mysitedotcom/item.php?page=one.
Of course, since you're asking this in a Smarty forum, you could use an output filter to append the onclick event if you wanted to.
This wouldn't be very pretty though. The more elegant way IMHO is to simply have the links point to mysitedotcom/one and use Apache's mod_rewrite to rewrite the urls to mysitedotcom/item.php?page=one. No need to bother Smarty with it at all. |
|
Back to top |
|
blackhawkmx Smarty Regular
Joined: 20 May 2005 Posts: 76
|
Posted: Sat Nov 22, 2008 2:37 pm Post subject: |
|
|
yeah, thanks for the good tip! _________________ Bring it back to basics. You and I can make it right! |
|
Back to top |
|
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|