Drupal: How to get views argument into header/footer/empty view
I found this code snippet:
<?php
$view = views_get_current_view();
$arg0 = $view->args[0];
?>
but i don't know where to b开发者_运维问答egin inserting this php code snippet.
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.
- Edit your view -- Administer -> Site Building -> Views -> List, then click Edit for the view you want to modify.
- Click Defaults or one of the other displays for your view (e.g. Page, Block, etc.).
- 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.
- Under the input box, click Input Format to reveal the options, and choose PHP Code.
- Paste your code in the box and add some code to do something with the argument.
- Click Update to update the Field. Click Save to save the changes to the view.
精彩评论