Spirit Library - complex panels 2/views based drupal site

Spirit Library is library of spiritual messages and information. It contains thousands of articles/messages from spiritual speakers and authors which are filterable and sortable in different ways. The site extensively uses the excellent Panels 2 modules alongside Views.
This is the third incarnation of the site, and the one that finally gets very close to where we wanted to be with it. The first version was launched 18 months ago as a Plone site, as that was the CMS i had most experience with, but after a while it became too restrictive and we started looking in Drupals direction. For the second version we migrated the site from Plone, and the change coincided with a large jump in traffic and at the same time gave the vps it was hosted on more room as it used less server resources (especially memory).
Content Types
The Content Construction Kit module is used throughout the site to allow us to add the different types of content we need - messages, people, spiritual groups etc.
The main content type on the site is for the messages, each message has an Author and some messages also belong to a spiritual group. We use Node Reference fields to track these relationships, and to help with the theming the site we built a series of custom functions that allow easy access to the parent or child nodes.
The url's of each message contains either the author or the group so we combine the pathauto module along with custom tokens to determine what the path should be at the time of saving (using the token_values hook). If it has a group set we use that path, otherwise we use the author name. e.g. /group-title/message-title or /author-name/message-title.
We use a few other fields throughout the site including Embedded Field for youtube videos, Date fields (with the JSTools calendar) and we also use some ActiveSelect tweaks to make content entry easier.
Migration from Plone
After a lot of research and thought, we used the Import HTML module to import the site from Plone.
The first step was to make the structure and content types we needed in Drupal to mirror those we already had in Plone. Then from the Plone site we created some simplified templates that outputed a list of links to only the pages we wanted to export, mainly the messages themselves and author profiles.
To make importing easier we then wrapped the different fields on the page with div/span tags, setting the id to the drupal fieldname so import_html could understand:
<div>A message from <span id="field-person">Author Name</span></div>The reason we chose this approach rather than creating full xml templates was just simplicity and time, and it also meant that it was easier to keep the same url structure inplace.
Once the templates were created we ran a recursive wget command on the same server to save every page we wanted to import into a folder that maintained the correct structure. We then ran Import HTML's import command and pointed it to the relevant base folder and chose which content type to use to import. To prevent memory errors we imported pages section by section, usually a 100-200 at a time.
Panels

The main layout of the site is created using the flexible layout of panels 2, which is a really great module - thanks merlinofchaos!.
We use panels in a few different ways throughout the site:
- Simple panel pages such as the homepage, these contain a selection of blocks, views and mini panels.
- Views based panel pages, these usually contain a view on the left such as the messages, archives or videos pages. They pass arguments into the views and also have a filter on the right which allows targeting the information shown
- Node panel pages, these as used for the individual message and the author profiles, allow display of the content of the node as well as contextual information about the message's author or group. These use the node id context along with different layouts for each content type
- Mini Panels are also used to create the tabbed blocks used through out the site. Using the tabs panel style makes this very simple indeed
Views

Throughout the site we use some custom modules for manipulating the near-essential views module and adding filters dynamically. The argument handling in views is very good but it didn't give us enough control over the url's.
So we built a custom module that parses the argument array (fired from the argument handler php code) and determines exactly what kind of filters and sort methods are required. Then it programmatically adds them to the view by manipulating the views object. (more info on dynamic filters)
This gives us much better control over the url, for instance in the message section we have the following structure:
Default:
/messages
Sorted
/messages/popular
Filtered by Author
/messages/author-name
Filtered and sorted:
/messages/author-name/popular
A futher example of this is the archive section where we allow you to drill down by date and view information either yearly, monthly or daily. You can also view the information filtered by author or group and it retains the period of time you were looking at before you started filtering. The custom modules mean that the entire archive system only uses one view for all the information it shows, and it also has some currently hidden features like the ability to switch views layout based on the url:
/messages/archive/2007/1 (normal table view)
/messages/archive/list/2007/1 (teaser view)
/messages/archive/calendar/2007/1 (uses calendar module)
The filter block on the right allows you to filter the current view by author, and maintains the same sorting and view layout when you add it and remove it.
Search
The search system, which uses Views Fastsearch, needs to go through some peformance tweaking and caching but does allow the search results to be filtered by node type and also filtered by author and date. It also allows sorting using different methods like relevance, popularity (view count) and date.
/search/messages/keywords
/search/videos/keywords
/search/messages/keywords?sort=by-date
/search/messages/keywords?person=author-name
Forum
We use the Advanced Forum module to assist with theming our Forum to look better.
We also modified further to allow a view count for each of the threads in the topic list
User Profiles
For our small but growing community we use the Advanced Profile module combined with Bio & Panels to allow our users to create a profile about themselves. It uses a content type that contains a selection of fields which for this third version we had to migrate from the regular drupal user profile fields.

Drop Down Menus
The drop down menus used on the site are currently a custom module which was created from various bits of code I already had for non drupal projects and then some routines i took inspiration from to convert it to work in drupal. It does however use the regular drupal menu system - in this case they are the primary links. I do plan to review the code soon and release it as a drupal module, but at the moment it is pretty site specific.
Future Plans
The next stage for this site is to build a book section, linking into the amazon affiliate system and combining it with a drupal based review system. We are also going to add the favorite nodes module.
We are also looking to review all the custom code for this site, and to see where we can improve and package them up to be less site specific. We want to use them on our own future sites as well as make them into (or contribute into existing) drupal modules.
Any questions or comments, please let me know :)
List of main modules used
thanks to all the authors and maintainers)
Content Construction Kit / CCK
Pathauto
Panels 2
Views
Embedded media field
Views Fastsearch
Image
Imagecache
Javascript Tools (collapsiblock, tabs)
Tabs Panels Style
Advanced Forum
Advanced Profile
Bio
Filter Default
Admin Menu
Dev
BUeditor
Calendar

Very nice
The site is beautiful and a great showcase for panels. Thanks for writing this up in detail.
Michelle
--------------------------------------
See my Drupal articles and tutorials or come check out life in the Coulee Region.
?
Site does look good, but is this supposed to be on the front page?
--
John Forsythe
Drupal Modules - Find the module you need for your project!
Yes
We like to promote posts that detail how a site was built. It may not be as flashy a write up as the popsci one, but it's worth showing off how smaller companies / individuals can build nice sites with Drupal.
Michelle
--------------------------------------
See my Drupal articles and tutorials or come check out life in the Coulee Region.
+1
+1 for putting this on the front page of drupal.org. It is nice to see a little bit of "how-to" on the front page for a change. Announcements are nice, but this post helps inspire.
I really like the mix of views/panels on the "author pages". I'm also curious as to how the users of the site handled the Plone to Drupal experience...
-Bryan
CMSReport
migration from plone
I will try to include some information about the migration from plone in my updated write up, but the main module I used was Import HTML.
First i created the CCK types to match those i had on the plone site with the correct fields. Then on the plone side i created some templates that outputted the fields in simplified html, so it was easy to parse the fields and fieldnames. Then i used wget to save the entire site to disk keeping the folder structure the same as the url structure.
Back in Drupal in Import_HTML, I then chose the default content type i wanted to use for the import and gradually did section by section (otherwise i ran into memory errors). In total I had over 1500 messages to import and apart from a few things that needed tidying up it went pretty smoothly.
+1 for putting this on the front page of drupal.org.
+1 for putting this on the front page of drupal.org. Great website.
Thank you
Michelle,
Thank you for the compliments about the site and for promoting this to the homepage!
It was a lovely surprise to see it there! If you feel it would help i'd be more than happy to expand and tidy up the write up,
Thanks for your Advanced Profile & Advanced Forum modules by the way, i found them very useful both in terms of what they could do and also understanding the way you did it helped me learn a bit more how the forum and panels modules could be interacted with.
Many Thanks!
Ben
Great!
Glad you found them useful. If you could expand/tidy up, that would be wonderful. Just attach it as a comment and I can edit the original post and replace it with the updated version.
Thanks,
Michelle
--------------------------------------
See my Drupal articles and tutorials or come check out life in the Coulee Region.
Updated Writeup
I've been working on an updated write up for the site with a little bit more info and more links to the modules used.
http://spiritlibrary.com/writeup/sl_writeup.html (html with images)
http://spiritlibrary.com/writeup/sl_writeup.txt (no images - and no paragraph tags)
It would be great if you would post it for me Michelle, but i'm here to make any changes to the format if you need it.
Done
Original post updated. Thanks so much for taking the time to expand the writeup. It looks awesome! The baby's crying so I'll have to read it later but it looks very thorough from a quick look.
Michelle
--------------------------------------
See my Drupal articles and tutorials or come check out life in the Coulee Region.
Links and some of the custom code would be great!
Linking to the modules used for that extra bit of polish would be nice. Sharing the techniques in the custom views code would be really nice!
benjamin, Agaric Design Collective
drop-down menus
Hi,
Nice site! Mind me asking how you made the right-hand-side "Filter Results" block on the search page? Are you purely working with the URL arguments in this, or is it more cleverly-integrated with Views somehow?
Thanks,
Jeff
________
Drupal Development,
marmaladesoul.com
dynamic filters
For the filter blocks I didn't use the Views arguments at all, Instead i actually add filters to the view programmatically.
The argument handler in the view calls a function in a custom module, that parses the url arguments and query string and decides what information needs to be shown, how it should be filtered and what the sort order is.
Then it adds the required filters and sort methods to the view and if necessary changes the view layout before emptying the $args array and returning.
Thanks for the info...
Regarding your explanation on the filtering, do you have a more detailed explanation somewhere? And what do you mean by "custom module" is this filtering system, essentially, a custom module you created?
thanks
geoff gevalt
http://www.youngwritersproject.org
menu question
Nice work.
In list of used modules, you haven't mentioned any module related with your nice drop-down menus.
What module have you used for that menu?
---
Drupal Theme Garden
same question
I was going to ask the same question, some details about what you used to make the drop down menus would be great.
Nicolas
-------------------------
http://nic.ipwa.net
Thanks for sharing!
Great write up, thank you!
What I would like to know is why you moved from Plone to Drupal. At the time we neede to choose the CMS we wantet to offer to our customers, Plone fineshed second after Drupal. The technical server requirements made us decide to go for Drupal.
Please let us know why you migrated to Drupal. Since it is a lot of word to migrate all data, you must have had good reasons to do so.
Thanks!
-----------------------------------------
Joep
CompuBase, Drupal websites and design
reasons for moving from plone
I've covered Plone a little bit more in my expanded write up but the main reasons were:
It was quite a bit of work migrating from Plone, but it was something I felt worthwhile as after a couple of years of doing Plone sites I felt like it was time for a change myself as well as this site. Plone itself was starting to go in a new direction which meant lots of new learning, so I just decided to go for it. And looking back it was certainly a good decision, and i'm much happier now working in Drupal for this and my future sites.
Thanks for your detailed
Thanks for your detailed explanation. There are probably not a lot people out there that have experience in both systems.
Your comments above would be really helpfull for others when they are at the point choosing one or the other CMS.
BTW: I am glad we went the Drupal way!
-----------------------------------------
Joep
CompuBase, Drupal websites and design
Congradulations!!! Your site
Congradulations!!! Your site looks really different (better) than most drupal sites. ;)
Nice Write-up
I especially like the section about doing your migration.
~Professionally: Sony BMG - myplay.com
~Personally: sirkitree.net | drupalmao.com
+1
Thank you so much for the site write up!
This is a great article and thank you so much for taking the time to do this. It sounds like you did most if not all the work on this site yourself. Kudos!
Morgan Sully
Online Community Building
Digital Storytelling
Electronic Music
www.memeshift.com
"If you have knowledge, let others light their candles in it." - Margaret Fuller
This is really wonderful,
This is really wonderful, thank you :)
Awesome
This new panels look pretty and they are going to improve the functionality of the web site.
Get more internet traffic with Traffic Kahuna
Job well done
The site looks great. I am fairly new to programming and Drupal, and seeing you switch to PHP from Python is rather surprising because I was under the impression that the latter was one of the “it” programming languages. There is a lot of literature out there about how large PHP sites require a better back end (preferably Python and maybe PERL) in order to handle large amounts of data effectively. Since you are obviously experienced in this field, can you expound on this based on your experience. With sites like yours, I think it is clear that PHP combined with a powerful CMS like Drupal can play with the big guys. Thanks for the post.
I do like Python...
[monty python quote]
Is this the 5 minute argument, or the full half hour?
[/monty python quote]
I do like the Python language (and Monty Python too :-) ), but I did also have lots of experience in PHP too. I don't want to get into which language is better as I think its really an individual choice, but when comparing something like Plone and Drupal there is much more than the language they are written in.
They are both big systems, and in Plone's case it runs on Zope which runs on Python which adds another level into the equation. For my needs i just found that drupal worked better,
I think any system can be made to scale with the right hardware and system design - doesn't facebook run on php after all?
Congratulations
The site looks amazing, great work!!
I like the theme
Congratulation. This site es well to read. I like the design very much.
navi-tipps.de
Great writeup, site looks
Great writeup, site looks fantastic. Well done!
One thing I was wondering though was with the videos, what did you do to so neatly integrate them?
One of my sites I want to add videos, and make it so that users can create their own videos simply by posting the YouTube link. I take it this is how yours work?
Any further information you could provide would be greatly appreciated! Thanks!
I used Embedded Field
This part is actually very easy using the excellent module Embedded Field / emfield
It does then give you a field where you can enter the youtube link (or even google video, brightcove, plus plenty more) and it does all the rest. If you have a youtube api key it also handles the thumbnails for you and integrates with views.
awesome overview!
thanks for the breakdown.. this sort of thing really gives some insight to those of us aspiring to be drupal theming ninjas one day! :P
-=- christopher
i love your home site as well
i love the spiritlibrary and your home site, you have a wonderful talent for colors, i felt very good just looking at the pages, the drupal site is beautifully designed a wonderful concept for a portal. congrats
Thank you
Thanks every one for your lovely compliments! - they are really appreciated ! :)
socialtalker: if you meant our radiantflow site, although very simple in comparison, that is also a drupal site. Happy you like both sites! We do put a lot of time into choosing the colors for our sites so its lovely to hear you feel good looking at them!
Great
Your Drop Down Menu ist absolutly great. Would love if you could share it soon!!
i'll try soon
I will try and see if i can package this up soon, in the meantime if you need a menu system you might check to see if Nice Menus can work for you.
Group
You mentioned using CCK to create groups...so that means you didn't need to use OG for this? How did you create groups and then associate the users to the groups? OR are they just completely separate?
Nice site overall and nice profile setup!
different kind of groups
When I use the word groups for this site it has a different meaning to when its used in Drupal/OG.
For my usage its nothing more than a container for a set of messages and authors - it doesn't need the features of OG.
Drupal 6?
I assume this is a Drupal 5 site?
Drupal 5
Yes the site is Drupal 5 since it uses a lot of modules.
Very interesting site
You've done a great job with this site. I am particularly interested in the way you have integrated the content. That would be extremely useful for us as we attempt to build some better organization with our own sites which are getting quite large.
I am interested in several things.... One is the way you use filters and arguments and, apparently, a custom module, to help the user sort and search. In our primary site this would be extremely useful but in our other, customized sites, it would be critical.
To explain, we operate Web sites to help students write. On our primary site we have upwards of 25,000 pieces of student generated writing, several thousand static pieces by us (tips mainly), about 3,000 forum entries and about 35,000 comments.... We are looking at really developing our tag system to allow for both required choices and freetagging as a better way of helping students see the genres they're interested in.... Your sort system would add to the useability of such an organization model.
Our customized sites, meanwhile, are integrated into the classroom; better filtration and search would allow students and teachers to look at individual students' porfolios, common assignments, and genre types. I think it also might allow for some organizing of individuals' overall comments....FYI, a lot of teachers require their students to do a certain type of and quantity of commenting on other students' work....
ALSO, and I'm sorry to go too long here.... Did you use panels2 with a set theme or did you design the theme yourself? Can panels2 be integrated into another theme?
Would love to also see how you did drop-down. I'm presently using a modified Ropple Theme that has wonderful drop-downs but I'd love to be able to modify them....
Anyway, really good work and thanks for sharing it with the Drupal community.
geoff gevalt
http://www.youngwritersproject.org
Filter system & Drop Downs
Geoff
Regarding the Filter system, i would love to package it into a module, but right now its not totally clear how to turn the site specific code into something much more usable and adaptable.
I have had someone contact me today also interested in this, and possibly sponsoring some of the development of this module to speed things up a little. I'd like to do it anyway, but since i have several active projects at the moment it would certainly help.
Regarding the drop down menus, i noticed you had some on your site - what are you looking to edit, the menu items or the visual side?
Thanks...
Thanks so much for responding. And again, nice work. Regarding the module development, we may have a little scratch to help but right now we are seeking funding for continuation and expansion of our work. If we're successful, we'd love to talk to you about it; whatever help we could be would be modest.
My interest in this would be to build a powerful filter system that would allow students and teachers to create comprehensive individual portfolios of work -- blogs, podcasts and various forms of nodes as well as comments. Commenting is a very important part of our primary site as well as our school sites and it is very difficult to sort the comments; there is another module that helps sort comments by user, but it has some limitations because it is tied to profile access. Also, I'd love it to all be in one place in a portfolio page.
Which gets to the drop down question....which is really related to using panels2. Can panels2 be used with any theme? Or do you end up creating your own theme when you use it?
Anyway, I really appreciate your efforts and I don't want to tie up a lot of your time to answering my questions. Glad you took a look at our site....
geoff gevalt
http://www.youngwritersproject.org
panels
As Michelle mentioned below, panels2 is a module rather than anything related to themes.
The output from the panels module is within the content area of the site, so you have your regular header, navigation menu and footer, then in the middle you get the panels.
The great thing about it is it lets you create complicated multi column layouts and you can drag 'n drop different elements such as nodes, views and blocks around the page. It has a couple of stylesheets - but they are only used to manage the columns and rows you need.
So yes you can use it with any theme, its completely independent of themes. Once you've set it up you might want to theme its output like you do any other module but its not necessary.
Panels 2
"Can panels2 be integrated into another theme?"
Panels 2 can be used with any theme. It's a module, not a theme.
Michelle
--------------------------------------
See my Drupal articles and tutorials or come check out life in the Coulee Region.
How to add content links to user profile?
Very nice!!! I have a question. How to add content links to user profile?
Advanced Profile & Bio Modules
If you are asking about how to create the list of topics a user has participated in on their profile - then the answer is through the Advanced Profile module.
That uses Panels to allow you to show all sorts of info about the user. I also use the Bio module to allow custom fields.
I enjoy posts like these
I really do enjoy posts like these. Keep 'em coming!
The spirit library
Nice, this spirit library, I am very curious to take a look. I was a long time looking for something like this, sometimes not so easy to find good spiritual resources on the net.
I sincerely hope that this one will keep on growing :-)
See you later,
Steven - Belgium
Thanks
Thank you! A well-written and interesting walktrough of your site.
This is a cool site!! Thank
This is a cool site!!
Thank you for the detailed write up! I loved the colours and the design too! :)