views:

462

answers:

1

I found this code snippet:
<?php
$view = views_get_current_view();
$arg0 = $view->args[0];
?>

but i don't know where to begin inserting this php code snippet.

+1  A: 

You want to use a view argument in your view's header, footer or empty text fields.

You would enter this code in the view's basic settings.

  1. Edit your view -- Administer -> Site Building -> Views -> List, then click Edit for the view you want to modify.
  2. Click Defaults or one of the other displays for your view (e.g. Page, Block, etc.).
  3. In the Basic Settings box you will see lines for Header, Footer and Empty text. These probably say "None" next to them, but click the None to expand the input box.
  4. Under the input box, click Input Format to reveal the options, and choose PHP Code.
  5. Paste your code in the box and add some code to do something with the argument.
  6. Click Update to update the Field. Click Save to save the changes to the view.
sbc
You need to turn on the PHP module to enable the PHP input format.
Grayside