Search icon CANCEL
Subscription
0
Cart icon
Your Cart (0 item)
Close icon
You have no products in your basket yet
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Conferences
Free Learning
Arrow right icon
Arrow up icon
GO TO TOP
Drupal for Education and E-Learning - Second Edition

You're reading from   Drupal for Education and E-Learning - Second Edition You don't need to be a techie to build a community-based website for your school. With this guide to Drupal you'll be able to create an online learning and sharing space for your students and colleagues, quickly and easily.

Arrow left icon
Product type Paperback
Published in Jun 2013
Publisher Packt
ISBN-13 9781782162766
Length 390 pages
Edition 2nd Edition
Languages
Tools
Concepts
Arrow right icon
Toc

Table of Contents (23) Chapters Close

Drupal for Education and E-Learning - Second Edition
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
1. Introducing Drupal FREE CHAPTER 2. Installing Drupal 3. Getting Started 4. Creating a Teacher Blog 5. Enrolling Students 6. Creating the Student Blog 7. Bookmarks 8. Podcasting and Images 9. Video 10. Forums and Blogs 11. Social Networks and Extending the User Profile 12. Supporting Multiple Classes 13. Tracking Student Progress 14. Theming and User Interface Design 15. Backup, Maintenance, and Upgrades 16. Working Effectively in the Drupal Community Index

Using Views and PHP snippets together


Individually, both the Views and PHP snippets let us do some amazing things; when used together, we have even more options. In this section, we will cover one technique that uses a snippet to pass arguments to a view. This technique can be adapted to different contexts to provide some very powerful methods of creating dynamic navigation paths through content.

This can be very useful when tracking posts in a site that uses Organic Groups. In our example, we will create a view that takes two arguments: the group ID and the user ID. These two arguments will allow us to display all of the posts created by a specific user in a specific group.

Our PHP snippet will display a list of groups to which the currently logged in user belongs. The membership of each group will also be listed and clicking on a username will pass the arguments—the group ID and the user ID—to the view.

Creating the view

To create this view, we will clone the Tracker view that ships with the...

lock icon The rest of the chapter is locked
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