Hi,

i want to pass an external Website-URL as an argument in views.

I created a page in views, wich is called:

http://localhost/viewspage/

Now I want to pass the argument "www.google.de/intl/de/about.html" into views:
http://localhost/viewspage/www.google.de/intl/de/about.html

Unfortenatly it is cut off after the first slash.

So I decided to make a base64 encoding and decode it via a custom-php code (default argument) in views:

http://localhost/viewspage/d3d3Lmdvb2dsZS5kZS9pbnRsL2RlL2Fib3V0Lmh0bWw=

custom code:
$args[0]=arg(1);
$args[0] = base64_decode ($args[0]);
return $args[0];

This does not work too. Does anyone can give me a hint? How can I pass an argument that contains an url?

Thanks

Comments

dawehner’s picture

Status: Active » Fixed
custom code:
$args[0]=arg(1);
$args[0] = base64_decode ($args[0]);
return $args[0];

This is views on drupal5 handling code.
Read the description below the text field. There is $argument and $handler->argument.

spamwelle’s picture

Status: Fixed » Active

I can't see a description below the field. How can i access this parameter? Could not find an answer after long time searching...

$handler->argument = $url;

?

dawehner’s picture

Status: Active » Fixed

Well

      '#description' => t('Enter PHP code that returns TRUE or FALSE. No return is the same as FALSE, so be SURE to return something if you do not want to declare the argument invalid. Do not use <?php ?>. The argument to validate will be "$argument" and the view will be "$view". You may change the argument by setting "$handler->argument". You may change the title used for substitutions for this argument by setting "$argument->validated_title".'),

=> $argument.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.