Planet Drupal
Rootwork.org: Grow your own: Learning custom base themes at Drupalcon Portland
Ah, base themes.
If there's an analogue to the Windows/Mac/Linux battle in Drupal land, it's probably Zen vs. Omega vs. AdaptiveTheme.
Garrett Dawson and John Ferris have a way out of that eternal struggle: Custom base themes. As they put it in their Drupalcon Portland session description:
"By necessity, base themes make assumptions about how teams and individuals work. By rolling your own, you’ll become much more comfortable and informed about the Drupal theming layer, and have a better launchpad for your front-end projects."
Here in Portland we take home gardening and permaculture seriously, so what better place to talk about "growing your own" custom base theme!
I spoke with John and Garrett about how creating your own base theme can make work for you and your team easier. Take a gander at their session, “Dapper Drupal: Custom Tailored Themes,” on Thursday at 2:15 PM for the full story!
IB: Base themes that are out there make some assumptions about how you want to theme. What's the advantage to rolling your own base theme rather than finding the theme that already makes the assumptions you do?
JF and GD: If you can find a base theme in contrib that fits perfectly into your workflow, by all means, use it. There's a lot of solid tools out there. We don't want to deter people from using and contributing to them. With that said, we feel it's unlikely a contributed base theme will be ticking all the boxes and making all the right assumptions about your workflow.
There's no one-size-fits-all approach. Your front-end process is heavily influenced by team dynamics, contrib module choices and a whole host of other considerations. The majority of base themes cannot account for those variables like you can. We want front-end developers to take a critical look at their tools to see where they can make improvements. That may mean creating a custom base theme; a custom starter theme for use with an existing base theme; or even a set of helper modules.
All the popular base themes started because someone wasn't happy with what was available at the time. The ultimate goal is increasing efficiency while improving the quality of the final HTML, CSS and JS.
IB: Do you recommend custom base themes for big shops? Small distributed teams? Freelancers? Everyone?
JF/GD: Yes, all of the above. At least consider it as an option. If you find yourself doing any kind of repetitive work, there's an opportunity for improvement. The only people who should steer clear of custom base themes are those new to Drupal. You need to be familiar with the tools that are available before setting out to create your own.
IB: Besides your the custom base themes you developed yourselves (Center and Prototype) what other custom base themes have you seen in the wild?
JF/GD: Yes! We've learned a lot working with and iterating on Center and Prototype. They work well for the structure of our team and the type of work we do at Aten. However, we realize every team is unique. We were really interested in seeing how other organizations were approaching the front-end problem space. We chatted with a range of teams of varying sizes working across different industries. Everyone has their own unique set of tools based on their own strengths and constraints. We're excited to share those with you, but you'll just have to come and see for yourself!
Images: National Archives and Flickr user McBeth.
Join Rootwork on Twitter, Facebook and SlideShare.
Learn about Rootwork's services for nonprofits and social change.
Linux Journal: Drupal Is a Framework: Why Everyone Needs to Understand This
Everyone planning and building Web solutions with Drupal benefits from understanding what a "hook" is—and why Drupal is not a CMS. more>>
Modules Unraveled: 062 Kraftwagen with Rolf van de Krol - Modules Unraveled Podcast
- On the kraftwagen.org it says that Kraftwagen is “Drupal for large (distributed) development teams and staged deployments.” Can you elaborate on what exactly that means?
- (Rolf) pain of configuration in DB. Everything in code is essential. Standardized workflow
- What do you mean when you say “Drupal for developers”?
- It states that everything is in code. Does that include info from the database, like configuration?
- How does this compare to the configuration management initiative in Drupal 8?
- How does it integrate with multiple deployment targets like local, staging and live environments?
- It mentions skeletons, what are those?
- (Rolf) start points. mention scaffolding
- So, how does this all work? What are the components of Kraftwagen?
- (Rolf) kraftwagen (drush extension) and 2 important modules (kw-manifests and kw-itemnames). explain the workflow of Kraftwagen (setup, build, init db, update)
- On the site is says something about Environment awareness, and mentions that the Devel module shouldn’t be enabled on a live server, but should on a development environment. I get around this by using a global git ignore file on my local machine that ignores the devel module. So, when I spin up a new site on my local machine, part of that process is to install the Devel module, but my system prevents it from ever being pushed anywhere automatically. How does Kraftwagen deal with that?
- (Rolf) builds are not environment aware, but dependencies and manifests are.
- Are you familiar with Aegir? How would you compare the two?
Robert Douglass: Be on stage with Rob and Jam at Drupalcon Portland!
Every Drupalcon, Jam and I welcome people to the conference in our own special way. Whether it's Dirndl's and Beer in Bavaria, The Spirits of Drupalcon, or an iPad Orchestra, we always try to keep it fun but informative. This year we've got a special theme picked out and we need some volunteers. So if you want to play along, and can commit to being at the session on Tuesday, May 21, from 10:15 to 11:15, fill out the form below and we'll get you on stage as part of the show!
Oh, did I mention there are prizes to win?
E-mail * Drupal.org profile page (URL) * Skype, IRC, Google+ or other chat ID * I'll contact you via this channel to discuss details of the show. I solemnly swear to be at the session Tuesday, May 21, at 10:15 * So help me Druplicon The Price is Right I'm familiar with "The Price is Right" Sign me up, I want to play! What CMS systems have you worked with in the past? Check all that apply I write code for a living I've worked in software sales I've worked in software procurement I've been a product manager for a software company Wheel of Fortune I'm familiar with "Wheel of Fortune" Sign me up, I want to play! Check all that apply I'm a Drupal site builder I use Drush I'm multilingual Jeopardy I'm familiar with "Jeopardy" Sign me up, I want to play! How many Drupalcon's have you attended? none, Portland is my firstonetwothreefour or more American Idol I'm familiar with "American Idol" I have talent! I'm going to be a star! What's your crazy talent that you can display in 90 to 120 seconds? Bonus points if you can demonstrate this talent by providing a link, or even a Skype audition with Robert! By submitting this form, you accept the Mollom privacy policy.
Evolving Web: Mastering Nginx by Dimitri Aivaliotis - Book review
I can confidently say that this book will teach you a lot about nginx, both as tutorial and reference. It's now mandatory reading for anyone on our team who will ever touch an nginx config file.
read moreMediacurrent: Weather.com Moving to Drupal
Today, Mediacurrent and Acquia are proud to announce that one of the highest profile websites in the world, Weather.com, based in Atlanta, will be joining the Drupal community! To my knowledge, Weather.com will be the highest traffic Drupal site in existence. Over the last six months, Mediacurrent and Acquia have been shepherding Weather.com’s on-ramping of Drupal via a proof-of-concept and discovery engagement.
More than anything, this adoption helps further advance our region's commitment to Drupal and open-source technologies. We are really excited about the positive impact this project will have on our local Drupal ecosystem.
Please see my blog post on Acquia’s website for the entire story.
LevelTen Interactive: So You Wanna Be a Rock Super Star?
One important factor of running a company, as well as becoming a rockstar developer, is efficiency. Here at LevelTen we are constantly tweaking and revising our development processes to become as efficient as possible while still providing clients with the best possible solution for their website needs.... Read more
Palantir: Join Palantir at DrupalCon Portland
Next week, a gaggle of Palantiri, and more than 3,000 of our closest friends, will descend upon Portland for DrupalCon, an international conference that brings together a worldwide community of enthusiasts, users, developers, designers, fanatics, and many others who in myriad ways support and play nice with the Drupal open-source content management framework.
This year, we're proud to announce that we are supporting the conference in a big way. As Platinum sponsors of the conference (and Supporting Partners of Drupal Association), Palantir builds on our commitment to actively contribute to the Drupal community by educating those who work with Drupal from beginner to advanced, evangelizing audiences for whom Drupal would provide the best content management solution, and helping to support major strategic community initiatives like Drupal 8.
In addition to sending a contingent of Palantiri who will be holding court at our booth and speaking at sessions, we are also sponsoring some special guest attendees. If you're going to DrupalCon, make sure to stop by Booth 333 to say, "Hi," and pick up a little something we made for your downtime in Portland: Palantir's Portable Portland Pocket Planner. And, should you hit any of our suggested destinations, it would be cool if you could Tweet about it using #PalantirPDX.
Who's GoingPalantir is sending a great mix of people to DrupalCon Portland including folks new and old to Palantir and big enough to form a decent a kick line: Robin Barre, Beth Binkovitz, George DeMet, Nancy Essex, Larry Garfield, Steve Persch, Dave Reid, Ken Rickard, John Albin Wilkins, and Rodney. Any one of us would enjoy learning about what's on your mind as we inch toward Drupal 8.
Who's SpeakingCheck out the below sessions at which folks from Palantir will be presenting or speaking, and make sure to share your feedback or continue to the conversation with us at our booth.
Larry Garfield answers the question which plagues us: "Is Drupal a CMS?" on Tuesday from 2pm-3pm.
Steve Persch and Commerce Guys' Pedro Cambra take a different approach to plugins with, "Plugin Haikus" on Tuesday from 3:15pm-4:15pm.
The Palantir team gathers at the Day Stage to deliver the goods on the next version of Drupal with, "Drupal 8: The Good, The Bad and The Ugly" on Tuesday from 3:15pm-4:15pm.
Dave Reid talks Drupal 8's file management initiative with, "Throw New\Drupal\Core\Initiative\Filemanagement\Failureexception();," part of Core Conversations on Tuesday from 4:30pm-5pm.
John Albin Wilkins will participate in the "Using Twig: The New Template Engine in D8" roundtable on Wednesday from 3:45pm-4:45pm.
John follows that up with the lip-smacking, "Making D8 Mobilicious" on Wednesday from 5pm-6pm.
Larry Garfield, Sam Boyer and Rob Loach talk integration with, "Composer: There's a Module (or Library) for That"
on Wednesday from 5pm-6pm.
Larry Garfield and John Albin Wilkins will join others at the "Dries & Company Q&A" Core Conversations panel on Thursday from 2:15pm-3:15pm.
Larry Garfield is also speaking at the Symfony Live! conference running concurrent with DrupalCon, where he talks, "Modernizing Drupal with Symfony2" on Thursday from 1pm-2pm.
Building Bridges, Connecting CommunitiesInspired by the theme of this year's DrupalCon—Building Bridges, Connecting Communities—Palantir held a DrupalCon Pass Giveaway, offering free conference passes to applicants with an active interest in Drupal but for whom cost was a barrier to attending this year. After receiving dozens of entries, the below deserving winners were selected. Keep an eye out for them at the conference (we're hoping to engage them in our Day Stage session), and share whatever important bits of wisdom you have. (Actually, you might learn a thing or two from them.) Whatever you do, don’t scare them.
Minneapolis' Tess Flynn (socketwench) would like to participate in sprints and is also interested in professional development; Portland's Dalene Bloom (sunslant) wants to gather knowledge to build her first Drupal site; Portland's Ingrid Choy-Harris (quartz45) is interested in mentorship, networking and inspiration; Cleveland's James R. Stone (fndtn357) wants to connect with folks at Commerce Guys and Pantheon; New York's Carl Wiedemann (c4rl) just wants to continue to give every drop of blood he has to Drupal; Reno's Andy Guzman (andyguzman) recently crossed Dries' "I kick ass" threshold and wants to kick more of it; Vancouver's Colin Stone (scolin22) wants to beef up his engineering studies at University of British Columbia; and from Jalisco, Mexico comes engineer Elias De la Torre Aceves (eliasdelatorre) who wants to continue to support the Drupal initiative and strengthen its presence in Latin America.
Related to our pass giveaway, Palantir also donated at pass to Italian Vincenzo Rubano who successfully ran an Indiegogo campaign to raise funds which would allow him to not only attend DrupalCon but also take his first solo trip outside of Italy. Vincenzo has an inspirational story and we’re very excited to have the opportunity meet him in Portland.
All of us at Palantir look forward to seeing our friends, clients and associates at DrupalCon. Reply to this email if you want to try and get together while there, and use #PalantirPDX for tweets about our people, sessions, or if you go to any of the destinations offered up in our Portable Portland Planner!
Paul Rowell: Drupal as an Issue Tracker - A few options
A decent issue tracker, allowing you and your clients to report issues and track the progress, is key to any successful project. Issue trackers can range from a simple spreadsheet to systems like mantis or JIRA, some free and some paid. So when it comes to selecting a system to use how do you choose?
Web Omelette: Cool module: Insert View
Insert View is a cool module that lets content creators insert an existing View right into their content. Using a simple syntax, users can specify which View should be rendered, with which Display and what arguments should be passed as contextual filters.
Rootwork.org: Ninjas in your code at Drupalcon Portland: SASS with extends and placeholders
It's fair to say that in the last year, adopting the CSS preprocessor SASS has completely changed frontend development for me. That's a sentiment I've heard others express when they started using it — and I was pretty late to the party.
I got attracted to it initially through variables. We've all been there when a client or a designer wants to change a color and suddenly we have to change dozens or hundreds of values across CSS.
Dale Sande captures that kind of revolution in efficiency that SASS brings, as seen in a screenshot from his upcoming presentation at Drupalcon Portland.
But Dale, who's spoken plenty on SASS and organizes the Seattle SASS meetup, is taking us way past the SASS basics like variables, and that's why I'm excited to see his presentation next week.
Around the same time SASS came onto the scene, some thoughtful people were exploring more maintainable frontend development and CSS architecture through ideas/acronyms like OOCSS, SMACSS and BEM, and folks like Nicole Sullivan, Jonathan Snook (a Drupalcon featured speaker!), Nicolas Gallagher, and Harry Roberts.
I spoke with Dale about SASS, object-oriented CSS and some the things he'll be covering at Drupalcon. Be sure to join me at his session, "Sass: OO'S'CSS w/Extends and Silent Placeholders," on Wednesday at 2:15 PM!
IB: Some people argue SASS creates bloated code — do you see placeholders addressing that concern effectively?
DS: Sass doesn’t create bad code. Bad coders do.
The whole concept of placeholder selectors was designed to fight code bloat and be a more pragmatic solution to OOCSS. In my presentation, I illustrate how using the various techniques generate code.
The real "ah-ha" moment comes when we see how using placeholder selectors makes it easier to manage and literally re-use code — thus reducing dreaded CSS bloat.
IB: What's the advantage to using silent placeholders over mixins for a set of rules?
DS: Simply put, being able to re-use code without duplicating code. The use of mixins was the first part of being DRY with our code. Looking at the Sass it felt AWESOME! But when we looked at the output CSS, this is when we realized that we were all living a lie.
Our CSS rules were being duplicated tens, if not hundreds of times. We weren't being DRY, we simply put the onus of duplication on the machine.
Placeholder selectors embrace the one of the oldest concepts of CSS and that is to extend the CSS selector for reuse. But with traditional CSS this was difficult to do, especially when you were dealing with thousands of lines of code. Sass' @extend directive allows developers to create name-spaced reusable chunks of code that is portable, re-usable and extendable without duplicating anything.
IB: Do you see placeholders as helping to reduce the amount of tight coupling — scattering pieces of styles in multiple places?
DS: While Placeholder Selectors are a tool that can help with scattered code, it is not the only solution. Having a file/folder structure that embraces the different types of code, e.g. CSS selectors, placeholder selectors, mixins and functions, can assist in creating reusable modulare code and maintain a process of control over the many parts.
Images: Screenshot from Dale Sande's presentation.
Join Rootwork on Twitter, Facebook and SlideShare.
Learn about Rootwork's services for nonprofits and social change.
Acquia: Dream It. Drupal It. (Develop It!) DrupalCon.
Hey developers ~ new, experienced or otherwise, undecided!
DrupalCon Portland is just around the corner — have you thought about the week and what you want to accomplish? Keynotes, sessions, a new job, and "people to see" are certainly popular options. As one colleague put it, "Spending time with all the cool, smart people that I talk to online." Maybe just making sure you have some of these ten things to bring with you to Con is all you can muster right now.
DrewPull - The Drupal Blog: Drupal 7 Field API sample
Recently I had to create a custom field for a project I am working on. The field was not difficult to implement, it only had to store two values in the database, but I didn't found a sample tutorial for that so I want to share my experience with you.
If you take a look at the Examples module, you can find a sample field that stores one value in the database, but this sample will show you how to store more data. In fact this field will store two values retrieved from The Internet Chuck Norris Database. One numeric value that represents the joke identificatior and a text value that holds the joke itself, for example:
Chuck Norris once ordered a Big Mac at Burger King, and got one.
First step to create our custom field is to create the database structure to store the data. This can be done using the hook_field_schema in the .install file of your module.
/** * Implements hook_field_schema(). */ function field_chuck_field_schema($field) { $columns = array( 'id' => array( 'type' => 'int', 'unsigned' => TRUE, 'not null' => FALSE ), 'joke' => array( 'type' => 'varchar', 'length' => 2048, 'not null' => FALSE ), ); return array( 'columns' => $columns, ); }You can create as many columns as you want to store your data. Just take into account the supported types.
Next step is to create a .module file to hold the field specifications starting with the hook_field_info:
/** * Implements hook_field_info(). * Provides the description of the field. */ function field_chuck_field_info() { return array( 'field_chuck' => array( 'label' => t('Chuck Norris Joke'), 'description' => t('Creates a field for Chuck Norris jokes.'), 'default_widget' => 'field_chuck', 'default_formatter' => 'chuck_norris_joke', ), ); }In this hook we create our field name "field_chuck" and the default widget and formatter names. Then we describe the field widget with hook_field_widget_info telling Drupal the name of the widget, a label for it and for what field types it's designed:
/** * Implements hook_field_widget_info(). * Expose Field API widget types. */ function field_chuck_field_widget_info() { return array( 'field_chuck' => array( 'label' => t('Chuck Norris Joke'), 'field types' => array('field_chuck'), ), ); }Also we must tell Drupal the field widget structure with hook_field_widget_form:
/** * Implements hook_field_widget_form(). * Return the form for a single field widget. */ function field_chuck_field_widget_form(&$form, &$form_state, $field, $instance, $langcode, $items, $delta, $element) { $element += array( '#type' => $instance['widget']['type'], '#default_value' => isset($items[$delta]) ? $items[$delta] : '', ); return $element; }This hook implementation is different than the one in the Examples module but I guess this is more customizable because we can use hook_element_info to implement our own Form API element types with their values:
/** * Implements hook_element_info(). * Declare the field Form API element types and specify their default values. * @see field_chuck_field_process(). */ function field_chuck_element_info() { $elements = array(); $elements['field_chuck'] = array( '#input' => TRUE, '#process' => array('field_chuck_field_process'), ); return $elements; }Now we can create the field Form API elements in the #process callback function:
function field_chuck_field_process($element, $form_state, $complete_form) { $element['submit'] = array( '#type' => 'markup', '#markup' => t('Go!'), '#prefix' => '<div id="field-chuck-submit"><h2>', '#suffix' => '</h2></div>', '#attached' => array( 'js' => array(drupal_get_path('module', 'field_chuck') . '/field_chuck.js'), ), ); $element['joke'] = array( '#type' => 'textfield', '#title' => t('Chuck Norris Joke'), '#default_value' => isset($element['#value']['joke']) ? $element['#value']['joke'] : '', '#prefix' => '<div id="field-chuck-joke">', '#suffix' => '</div>', '#maxlength' => 2048, '#size' => 100, ); $element['id'] = array( '#type' => 'textfield', '#title' => t('Joke ID'), '#default_value' => isset($element['#value']['id']) ? $element['#value']['id'] : '', '#prefix' => '<div id="field-chuck-id">', '#suffix' => '</div>', '#size' => 4, ); // To prevent an extra required indicator, disable the required flag on the // base element since all the sub-fields are already required if desired. $element['#required'] = FALSE; return $element; } The final steps are:- Create the implementation of hook_field_load if we want to process the data before loading it in the field widget.
- Don't forget that the implementation of hook_field_validate and hook_field_is_empty are required for a correct field validation.
- Also we can implement hook_field_presave if we want to alter the data before storing it in the database.
- Create the custom field formatter using hook_field_formater_info and hook_field_formatter_view as I explained in a previous post.
The full example code can be downloaded from my Drupal sandbox and includes the javascript to fetch the Chuck Norris jokes, so I hope you will enjoy it :)
Tags: drupal 7fieldwidgetformatterDrupal PlanetAdvomatic: SASS + Compass + Modernizr and browser information detection
Jack, my co-themer here at Advomatic, and I will be doing a series of articles about how we use SASS and Compass on our projects. There are plenty of articles out there on what it is and how to get started, so we wanted to dig a little deeper, and share a few tips and ideas.
Credit: mccun934
Today I'll talk about Modernizr, which is a javascript library that will check to see if your browser supports HTML5 and CSS3 features. We use it on every project now to make sure we aren't serving unsupported stuff to browsers that can't handle it. One thing Modernizr does is add classes to your HTML tag, like "cssgradients" or "no-cssgradients," or "textshadow" or "no-textshadow" as the case may be. Combined with SASS, this can be a very simple way to limit your CSS3 work.
Here's an example of how we now apply any of our css3 theming, using the way SASS allows you to check for parent classes, and the nice CSS3 includes of Compass.
h1.title { // A double border, for browsers that support box shadows; single border for those that don't.border-bottom: 1px solid #c3c3bf;
.boxshadow & {
@include box-shadow($white 0 1px);
}
}
Here's a slightly more elaborate example:
#footer {background-color #114163: // a baseline background color
.lt-ie10 & { // dirty proprietary filter for IE9 and below
filter: progid:DXImageTransform.Microsoft.gradient(GradientType=0,startColorstr='#2074b1', endColorstr='#114163');
}
.cssgradients & { // gradient for CSS3-supporting browsers
@include background-image(linear-gradient(#2074b1, #114163));
}
}
By the way, that handy ".lt-ie10" class on the html tag is standard now in Drupal's Zen base theme. It's very handy. While we try to avoid it, we also will add in classes for .mac, .pc, .chrome, .firefox and .safari, if we have some extremely browser-specific problems, which is rare. If you are curious, here's the javascript we use to add that information to the html tag.
Drupal.behaviors.targetBrowsersOS = {attach: function (context, settings) {
// Check to see which operating system we're using.
if (navigator.appVersion.indexOf("Mac")!=-1) {
$('html').addClass('mac');
}
else {
$('html').addClass('pc');
}
// Check to see if the browser is Safari and doublecheck that it is not Chrome.
if (navigator.userAgent.indexOf('Chrome') > -1) {
$('html').addClass('chrome');
}
if (navigator.userAgent.indexOf('Safari') != -1 && navigator.userAgent.indexOf('Chrome') == -1) {
$('html').addClass('safari');
}
if (navigator.userAgent.indexOf('Firefox') > -1) {
$('html').addClass('firefox');
}
if (navigator.userAgent.indexOf('MSIE') > -1) {
$('html').addClass('ie');
}
}
}
So, as you can imagine, this gives you the ability to customize what css various browsers are served, and leaner, cleaner experience all around. Stay tuned for more SASS/Compass tips and tricks!
Phase2: Ready, Set, Go! Spin Up An Omega Layout in 45 Minutes Flat!
Last night I presented at the SFDUG Meetup (you can find my slides on the Phase2 slideshare). There were some great questions and Drupal theming discussion at the end of my presentation. Here are a few of those questions that came up, as well as the answers:
Q: How does Omega compare to a simpler Drupal theme in terms of performance?A: There are trade-offs as with anything. Phase2 has used Omega for a number of large site projects including Georgia.gov and Fema.gov. There are scaling concerns with any complexity in a system but it is by no means a road block.
Q: Is Delta only used for Omega?A: Delta was made by the same people who wrote Omega, so this will be your best compatibility, but it is compatible with other themes as well.
Q: Can we use custom grid systems with Omega 3?A: Yes, you can. You have to write some custom code to handle compatibility. There is documentation you can refer to if you interested in trying it out.
To experience the full session experience, check out this recording of my session:
Omega from Download to Layout from Phase2 on Vimeo.
Thanks to the San Francisco Drupal Users Group for inviting me to talk!
Drupal Association News: Sponsored blog post: Drupal: the wonder CMS
Open Source software, namely Drupal, can be leveraged to accommodate the technology needs of numerous corporations across a vast spectrum of private and public sectors. The constant collaboration of the Drupal community gives users the freedom to rapidly deploy new innovations in a way that a closed proprietary system does not allow. Here at Achieve we are constantly trying to increase Drupal adoption by developing new solutions to help new stakeholders in new arenas.
Personal blog tags: DrupalCMSHealthcareSina Salek Official Site: Drupal Module : Calendar Systems needs your help
Calendar system requires a very tiny core patch to fully work, The patch was already proposed to core by a fellow developer, so i rewrote it to meet core requirements and set it to needs review (Thanks to Gaelan and wuinfo for helping in completing the patch). The good thing is that the patch is not only for Calendar Systems it's a generic patch that introduces a new hook to make it possible for third-party modules to alter format_date function. If we can get it into core it might even be possible to back port it to Drupal 7
You can read more about the history of calendar system module and even what a calendar system is
WebbyKat: Grouping by year (or month and year) in a view
Views offers a neat grouping mechanism that allows you to list content with matching criteria under said criterion. For example, if you had 3 press releases from 2011 and 2 from 2010, you could display them like this:
2011- Press Release #5 (April 1, 2011)
- Press Release #4 (March 31, 2011)
- Press Release #3 (January 25, 2011)
- Press Release #2 (December 3, 2010)
- Press Release #1 (June 1, 2010)
To do this, you create a view with three fields:
- Title (linked to node)
- Date (in Month Day, Year format)
- Date (in Year format; exclude this from display) -- if you want to save yourself some confusion later, open this field, go to the "More" section, and enter "Year (grouping header)" to make it clear why this field is there even though it's not shown
Next to your view format (unformatted list, HTML list, etc.), click Settings, and then pick your second date field as the grouping header under "Grouping field Nr.1". Check off "Use rendered output to group rows." Save.
I've done this quite a few times, but on my current site, I found that even when I told it to group by year, it was coming out like this:
2011- Press Release #5 (April 1, 2011)
- Press Release #4 (March 31, 2011)
- Press Release #3 (January 25, 2011)
- Press Release #2 (December 3, 2010)
- Press Release #1 (June 1, 2010)
This makes a little sense, since the dates all technically are different, but it's supposed to be grouping by the rendered output, which is just 2011 and 2010. I dug around and found that even though it looked like just "2011" to the naked eye, the code was actually <span class="date date-display-year" property="dc:date" datatype="xsd:dateTime" content="2011-04-01T05:00:00-05:00">2011</span>. The month, day, and even time values were still being stored even though they weren't visible.
To fix this, I opened the year field, went to the Rewrite Results section, and checked "Strip HTML tags." This gets rid of the code that differentiates the values from each other, leading to the expected grouping behavior. If you wanted to do the same thing for month and year grouping headers (e.g. December 2010), all you'd need to do is change the format of your grouping field to use the month and day instead of the year.
For more on date formats, see Modifying the page display for a monthly archive view (the "Three steps, for reusing" section).
Forum One: The Dream of Drupal is Alive in Portland
Like the ’90s, Drupal really is alive in Portland, the city made popular again from the much-watched TV show, Portlandia. Portland is the homebase for the Drupal Association and host for this year’s DrupalCon, Drupal’s largest North American conference.
This will be Forum One’s biggest presence at DrupalCon since we went to our first conference in Washington, DC, in 2009. We’ll have 17 web developers, project managers, and strategists attending the event from our offices in San Francisco, Seattle, and DC. We can’t wait to meet more Drupalers, share our experiences, and explore Portland!
During our Day Stage session, EPA.gov: Building a Sustainable Drupal Platform, we’re excited to share the challenges and successes we faced in migrating EPA’s large web presence to Drupal. In a “game-show” style session, we’ll investigate how we navigated the unique needs of a large government agency, share project challenges, champion our successes, and provide best practices for other large organizations considering moving to Drupal.
Another highly anticipated session is What Users Want (or Why Webpages are Dead) by Nam-ho Park and Stein Setvik. They’ll dive deep into real questions about the future of websites in the face of the rise of mobile and explore the implications for Drupal.
Each year, it is encouraging to see Drupal growing. With 613 active distributions and more than 25,000 contributors, Drupal is now the largest and most recognized open-source community. It will be interesting to see how keynotes from Dries Buytaert, Karen McGrane, and Michael Lopp address the sheer size of the project and how to get Drupal to even more users.
If you’re going to be in Portland next week, stop by our booth. We’ll have free “Nodetoriusly” awesome T-shirts that will be sure to take you back to the golden age of hip-hop. Plus, we’ll raffle off an iPad mini. And if you have a big heart and bright mind, consider joining our team by checking out our career openings. Come talk to us and help us keep the dream alive at Portland DrupalCon!
Like the ’90s, Drupal really is alive in Portland, the city made popular again from the much-watched TV show, Portlandia. Portland is the homebase for the Drupal Association and host for this year’s DrupalCon, Drupal’s largest North American conference.
Drupal Commerce: Commerce Module Tuesday: Commerce Product URLs
Welcome to another Commerce Module Tuesday! Today we are looking at Commerce Product URLs, maintained by Maciej Zgadzaj who is a senior developer at Commerce Guys. This project almost doesn’t require a video. If you’re running Commerce 1.6 or later, just go download this, enable it, and love yourself for making the world a better place. Actually, enabling the module, by default, doesn’t do anything, but the magic is there. And that’s where the video takes the next step. It shows us how to hack the URL to link directly to specific products.