 create a block of author s recent blog posts in this example you will create a contextsensitive block that shows the titles of recent blog entries by an author when viewing one of their posts this will demonstrate using views arguments to dynamically filter a view s contents at display time before working through this example enable the blog module and populate some entries from a few different users creating the view the first step is creating a view for our recent blog entries block because the block will show the titles of blog entries this view is considered a node type go to add new view  enter the following properties and click next  view name recentblogentries view description list of recent blog entries for a given author view tag blog view type node generating a list of blog entries it will be much easier to see the view progress if we can see it doing something in this section we will create a basic view displaying blog entry titles in the third column locate the fields area generally speaking fields are the pieces of information that you want to display in the view in this case node title click the   icon to add a field scroll down to defaults add fields  below the settings table a large selection of fields will be available in the groups dropdown menu select node  this will limit the list to only the default fields exposed by node module scroll down the list select the node title field and click add  you will now be presented with settings for the node title field delete the label from the label field so that each individual node title is not prefixed with the word title additionally check the link this field to its node box so that visitors who see an interesting title can click directly on it to read the blog entry to which it belongs when finished click update  if you scroll down to the live preview section you should now see a list of several node titles however both blog entries and other node types will be in the list let s fix that in the fourth column locate the filters area filters limit the results displayed in the view and we can use this to our advantage here by showing node titles only from blog entries and not every type of node click the   icon to add a filter as before scroll down to the defaults add filters section select node from the groups select box to limit the list of options to only those exposed by node module scroll down and select the node type field and click add  in the settings page that appears leave operator as is one of and select blog entry under node type  click update when finished now by scrolling down to live preview  you ll see that the list only shows blog entries adding context with arguments while filters are very useful for limiting the results of a view when the condition is always consistent for example a view of blog entry nodes should always be filtered by the blog entry type something filters can t do is smart decisionmaking based on the page context in our case we want the view to display a different list of blog entries when looking at a post by user admin than we do when looking at a post by user member and filters won t be able to help luckily there s another way to filter a view s content  arguments  through arguments views are able to obtain additional context typically via dynamic urls with ids in them and can take this context into consideration when displaying the view let s walk through adding and configuring an argument to our view so that we can change its contents based on post author in the third column locate the arguments area click the   icon to add an argument because we are basing the view around content authors  this time under groups select user  check user uid and click add  the defaults configure argument user uid settings page has a lot going on but only a few things that need our attention the title field here unlike the title field under basic settings  can be based upon the context that the view is being displayed in change the title to recent entries by 1 1 will later be expanded to the user s name based on the user uid argument when the view is displayed under action to take if argument is not present  there are a variety of options ranging from displaying a 404 or a 403 page to simply displaying all values in the view in our case if an argument isn t specified which it won t be since this view will be displayed in a sidebar block not as a page with its own url we want to give it a default one to act on select provide default argument  assuming javascript is enabled in your browser you should now get another selection for default argument type  select user id from url  which will then provide a new option  also look for a node and use the node author  select it this will cause views to first see if it can figure out a user id from the current url for example user 1 if it can t it will instead check to see if the current page is a node page such as node 42 and if so take the user id from the node s author field instead validator options provide a useful way to control what kind of arguments your view will accept select user as the validator  by default changing this setting will check the incoming argument and ensure it s a valid user id if not the view will be hidden from the page once you have changed the argument s title default argument and validator options click update to save your changes you ll notice that now the live preview no longer shows anything did we just break the view fortunately no it s merely abiding by our wishes to hide itself if there is no valid user id given to it try entering a 1 in the arguments box and clicking preview  you should now see a list of only user 1 s blog entries creating the block so the live preview is now showing basically what we want there s just one problem we have no way to stick what we ve done so far into a sidebar block let s fix that by adding a new display  in the first column under defaults  there is a select box containing entries such as page   feed  and yes  block  select block and click add display  there s not much else to do here as far as views is concerned under block settings  click the none link next to admin and fill in a description for the block in the administrative interface such as recent blog entries by author and click update  save your work by clicking the save button at the bottom of the views interface you should receive a message that the view has been saved next navigate to the blocks interface and drag the recent blog entries by author block to the right sidebar region or similar and click save blocks  you ll notice this appeared to do nothing no block shows in the sidebar but remember we are looking at an adminitrative page we are not looking at a page that would provide a user id context navigate to the main blog listing and click on an entry there you should now see a sidebar block titled something like recent entries by admin with a list of blog entries beneath it finishing touches there are still a few remaining things to do before our view is complete for example we said that the block was to show recent blog entries but instead it s showing them in the order they were entered with oldest on top additionally even unpublished entries are showing in the list currently return to the recentblogentries view edit page  add an additional filter by clicking the   icon in the filters section in the fourth column change groups to node and select node published  click add  under the published selection choose yes and click update  to handle sorting locate the sort criteria area just above filters and click the   icon there under groups  again select node  from the list of options check node post date and click add  in the settings page change sort order to descending  this will place the newer posts on top of the older ones click update when finished finally  save the view for your new settings to take effect  