mikrobi/babel — Issue #51: [Idea] Append parameters of current page
Author: Kernle32DLL
Created: 2012-01-27 13:00:29+00:00
State: open

Hi there,

We recently ran into a small problem with babel, and had to integrate this little hack to is, so it would work for our scenario:

One page of our website is basically just a pull-page, which dynamically shows content trough parameters passed via PHP GET. This page is avaliable in german and english, so linked both of them. Problem is, when the babel link is generated, the appended GET parameters are lost, and the page shows junk.

So, we created a nifty hack that appends the GET parameters of the CURRENT page to the babel link:

```php
// Append parameters
unset($_GET['q']);

if(!empty($_GET)){
$i = 0;
foreach($_GET as $key => $value){
if($i == 0)
$url .= '?'.$key.'='.$value;
else
$url .= '&'.$key.'='.$value;
$i++;
}
}
```

Inserted just after line 91 in the "BabelLinks" Snippet (after the $url var has been filled with content).

Might be worth considering integrating into babel, or at least some idea for a more professional implementation.

Greetings,
Kernle 32DLL