Site Nav

views

Block Visibility: by view and content type

You may want a block that provides some navigation for a view. I use this snippet to display the block on a view Page as well as when viewing content of a particular type. So for instance, I might have a view page which lists the current content of type 'story' called myview. On the myview Page, I also list each content's title in a block similar to a menu, so I can quickly move through the story titles.


Setup an RSS Feed

I wanted a couple of my views to offer RSS feeds. It's really simple.

Go to Administer - Views and click edit next to the view you want to add an RSS feed. Then setup an Argument: RSS: RSS Feed Selector and make sure it set to "Display All Values" and that's it.

The full instructions are at drupal.org, but it took me awhile to find them:

http://drupal.org/node/83597

The node says it's for 4.7, but it works just fine in 5.1


Pager On Top

When viewing a Page View, basic navigation is at the bottom of the page. I wanted this same "1 2 3 next>> last>>" to display at the top and the bottom of the main content area. It was easy enough. In page.tpl.php,
I added:

<?php print theme_pager() ?>

right above print $content; et voila any Page Views now have the pager on the top and the bottom of the page.


Views URLs and Arguments

So I finally figured out how to use Arguements in Views without breaking the view!

So I wanted a clean URL to a View which displayed all nodes for a particular vocabulary. without arguments the working URL is

www.rufdesigns.com/vocabulary/3

where 3 represents the vocabulary ID

I wanted to something simpler like:

www.rufdesigns.com/drupal

Edit the view and in the Page section set the URL the way you want it to look:

URL: drupal

In the Arguments section, add an argument to support all of the nodes associated with a vocabulary item:


Syndicate content