When outputting groups of items in a view it may be necessary to automatically create element ID names for bookmark purposes. For example, when creating long Views lists, you may want to have sub-items jump directly to an item in your list. To do this you will need to have a name id in your anchor tag. By modifying your Views output template you can easily achieve this.
First, locate the appropriate Views output template and copy it into your current theme folder (Instructions). The code for this example was used in views-view-unformatted.tpl.php:
Modify the title output in the template to something similar to:
<?php if (!empty($title)): ?> <?php $words = str_word_count($title, 2);?> <?php $bookmark = implode('-', array_slice($words, 0, 2));?> <h3 id="<?php print strtolower($bookmark);?>"><?php print $title; ?></h3> <?php endif; ?>
This will output something like: