Search icon CANCEL
Subscription
0
Cart icon
Your Cart (0 item)
Close icon
You have no products in your basket yet
Save more on your purchases! discount-offer-chevron-icon
Savings automatically calculated. No voucher code required.
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Free Learning
Arrow right icon
Arrow up icon
GO TO TOP
Drupal 5 Views Recipes

You're reading from   Drupal 5 Views Recipes 94 recipes to develop custom content displays for your Drupal web site

Arrow left icon
Product type Paperback
Published in May 2009
Publisher Packt
ISBN-13 9781847196965
Length 412 pages
Edition 1st Edition
Languages
Tools
Concepts
Arrow right icon
Toc

Table of Contents (22) Chapters Close

Drupal 5 Views Recipes
Credits
About the Author
Acknowledgement
About the Reviewer
Preface
1. Introduction to Views FREE CHAPTER 2. Working with Default Views 3. CCK and Views 4. Dates and Calendars 5. Views and Tools for Administrators 6. Views Galore 7. Theming and Layout 8. Navigating the Online Drupal Community Default Views in Drupal 5 Modules
Formatters
Style Plugins
Views Hooks for Coders
Modules Included in Recipe Ingredients
Additional Resources and Modules Mentioned in Recipes
Selected Noteworthy Patches to Views
Index

Recipe 4: Adding a Header to your View


Note

Ingredients

Completed Recipe 3

You can easily add custom text or graphics above or below your view content, using the Header and Footer fieldsets. We will add a brief description at the top of the Swim Groups page.

  1. Go to http://YOURSITE.com/admin/build/views. Your swim_groups view is now included in the list of views.

  2. Click on swim-groups in the URL column.

  3. Open the Page fieldset, and then open the Header fieldset contained within it.

    Enter the following header text:

    Swimming is a great sport which exercises the whole body. Swim lessons are available for all ages and ability levels. Note: A parent or guardian must accompany children under 5 when in the water.

  4. Open the Input format fieldset contained within the Header fieldset. Note that Filtered HTML is selected. See the Recipe notes if you would like to expand the list of available HTML tags.

  5. Scroll down to the bottom of the Edit view page, and click on Save.

  6. Enjoy the view.

Recipe notes

  • The Header fieldset (along with the Footer and Empty Text fieldsets) each contain Input format fieldsets. Input format filters will modify the display of text that has been entered by users (Input format filters are not connected to the filters fieldset that we described in Recipe 3). When a user enters text or code into a Drupal site, the text is saved in the database exactly as typed. Next time we view the text, however, it may not look exactly the same—some text and tags may not appear. To modify the list of allowed tags, visit the Site Configuration | Input Formats page, at: http://YOURSITE.com/admin/settings/filters.

  • The most common reason for using these filters is to protect your site from malicious users, or even from users who don't intend to be malicious but who exhibit bad form. The Input format ensures that scripts will not be run, and that badly formed HTML will not break your site's layout. Filtered HTML is the name of one of the default Input formats.

  • A terrific article by Robert Douglass offers helpful information on input filters at: http://www.lullabot.com/articles/drupal_input_formats_and_filters.

You have been reading a chapter from
Drupal 5 Views Recipes
Published in: May 2009
Publisher: Packt
ISBN-13: 9781847196965
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $19.99/month. Cancel anytime
Banner background image