background preloader

Module Help

Facebook Twitter

Using Drupal Contextual Filters in Views. It can take a while when you're new, but once you start to wrap your head around Views, that is when Drupal gets really fun. In this tutorial, I'll go over how to use Contextual Filters in Views to alter your content dynamically based on information in the URL.

If you're a visual learner, you can skip to the video at the end of this post for a detailed walk through of the process. Kittens vs Specific Kittens In this example, have page of cat photos. It's made with a standard view that pulls from content type 'Animals' and then narrows it down with a standard filter based on a Species taxonomy list. Drupal Contextual Filters allows us to filter content based on dynamic information. In the Advanced tab of your view, click 'add' next to Contextual filters.

Now you have some options, the two most important being: What to do when your filter is not in the URLWhat to do when your filter is in the URL In the first case, I've chosen to just display all the results as normal. Isn't Xander cute? Views Fluid Grid + taxonomy term view + term fields = online exhibits home page | Wordpress VS Drupal. Our online exhibits need an attractive home page. To make the view we decided upon Views Fluid Grid for the display (using imagecache of course to fix the width of the images). We use taxonomies extensively in our site to help create contexts among other things so using a term view to list all of our exhibits is a natural extension of the library philosophy.

Since not all of our exhibits are hosted on the same site we added a term field to provide a space for a dedicated home page on each exhibit. We also used taxonomy image to make the page more attractive. Views Fluid Grid Output It’s a bit long winded at ~3 minutes, but hopefully thorough enough for anyone following along As a result all our archivists must do to add a new exhibit to the home page is add a new taxonomy term to the archival taxonomy and the image and term description are posted to the fluid grid page. Taxonomy term with a single term field Views Fluid Grid settings. Custom contact form with conditional fields using webform and webform conditional | Friendly Drupal Free Drupal Tutorials. 1. Create a webform with fields After you install Webform and Webform Conditional, you can add a new webform at Home >> Administration >> Content.

Enter a title and (optionally) a short description. After you click save, you'll be on the Form Components page. Add a new Textfield called "Your name" and make it mandatory. Keep the default settings and click on Save component button. Create a field type email and make it mandatory. Create a new field of Select options type, give it a label "Request type" and make it mandatory. Next, create a textarea where the request is going to be entered. 2. Now we can create a list of States using, again, the pre-built option to populate values and choosing listbox. You can check if the form is working, but don't forget to clear the cache before you do it!

Now let's add the Canadian provinces in the same manner. Create a confirmation message and a list of email sending rules. Rule Scheduling and Emailing Views According to CCK date fields | Wordpress VS Drupal. Sometimes Drupal opens up a big can of whoop-up process on ya, and Rules Scheduler is one of those gems. Rule Scheduler allows you to use rule triggers to schedule rule sets. Use Case:Ever want to send an email the day before a scheduled event? We use CCK Sign-up and wanted to send an email to users one week before an event, as well as the day of. We also needed to send teachers views of the roster of students Here’s the 2 minute mojo on it and it just highlights the mistakes I was making.

The recipe came out of Drupal documentaiton, and these two tutorials got me 90% of the way: working with scheduled rules And I thought I was home free, however I ran in to a pretty stupid problem that took me a minute to understand = all the identifiers need to have tokens in them with unique values or else they overwrite themselves in the database. Solution? The nicely scheduled rules NB: I also ran in to a problem where cron wasn’t sending my emails initially. Learning library.