Planet Drupal
Six Mile Tech: Embedding an Entiyform on a Node
One of the most common questions relating to Entityforms is how to embed them on a node. This short video walks you through the steps.
Modules you will need
Drupal Commerce: Showcasing the latest Drupal Commerce sites
DrupalCommerce.org exists to help people learn how to use and develop for Drupal Commerce. In addition to the traditional education tools we offer in our documentation, video library, and Commerce Q&A, we host a showcase of sites built using Drupal Commerce. It’s one thing to tell people how to use a tool to build something, but it’s quite another to show actually show them the end result.
And the results are stunning.
Since launching, we’ve received dozens of showcase requests from developers around the world. These sites have varied widely in design, feature set, market, and size, and each one provides an opportunity for new developers to learn something new.
Our DrupalCommerce.org handyman Josh Miller just finished a redesign of the showcase that will make it even easier for you to find reference sites built using Drupal Commerce and learn how they were built. Our showcase is now organized by a variety of categories based on the products sold and the tools used. You can quickly scan a list of beautiful sites for design and feature inspiration, and in our featured showcases you can find a write-up or case study describing the modules and processes used to develop the featured site.
We aim to give credit where credit is due, so while we would love for you to share your latest work with the community, we would also love to link to your company or personal website so new users know who to look to for advice and consulting when they need help. Our featured showcases in particular give you an opportunity to talk about the modules you used (or contributed!) to build a site and talk about how you solved the various configuration and deployment tasks involved in launching a high quality eCommerce project.
Use the showcase submission form to get your latest creation featured today!
Open Source Training: A Beginners Guide to Drupal Overrides
The problem with many software applications is you can't make them your own. With Drupal, however, you have the option to override how Drupal does things. From altering a form to customizes the way your pages are displayed, Drupal provides options.
The concept of overriding something in Drupal can be made reality in several ways: Drupal's APIs, theme overrides, as well as overriding default configurations in modules. Whatever it is you need to do, the number one rule you should endeavor to follow is: don't hack the core (or a contributed module). Don't open the code files in Drupal and change them to meet your needs. There are better ways.
In this tutorial, we will focus on overriding themes.
Bluespark Labs: Rooms 1.0 Released and Roadmap
After almost 22 months since our initial commit on the Rooms project we are happy to announce a 1.0 release! We are really proud of this release as it brings together a rich set of features built on a flexible core that can grow and improve over time.
Our central objective with Rooms is to provide absolutely the best tool for creating booking experiences on hotel websites with an open-source solution. We want to free up accommodation owners to actually own and define that experience for their users and do that in a way that is unique to them.
There are three key ingredients that come together to achieve this.
Drupal - undoubtedly one of the strongest CMS’s out there, it allows us to construct truly elegant websites.
Commerce - a powerful Drupal-based open-source ecommerce solution that enables us to offer flexible and sophisticated checkout experiences for our users.
Rooms - it tightly integrates with Commerce adding the booking and room management layer dealing with a range of situations and features.
Put these three things together and you get Drupal Rooms. What, we believe, currently represents one of the most flexible open-source booking solutions out there. Check out our screencast for an overview of what is possible.
Rooms 1.0 Demo - Hotel Booking Management.
Rooms 1.0, however, is just the first step for us.
RoadmapNow that we have a stable core to built on top we are going to focus on two key areas.
Developing Rooms 1.xUsability Enhancements
Expect a constant stream of usability enhancements on the Rooms 1.0 branch. We want to not only have the most powerful booking solution but also the easiest to use. We already have great ideas about wizards to enable you to setup your Rooms-based hotel.
More use cases
It sometimes feels that there are as many feature requirements as there are hotels out there. Inspired by the Commerce ecosystem expect to see features added to the core but also add-on modules that will enable you to do more. We have a couple in the making that we can’t wait to share with everyone.
At the same time we will be working on a 2.x branch of Rooms. The focus here will be on growing Rooms in two directions.
Multiple Hotels and Hotel Owners
We want a module that will allow you to build in Drupal a site that can host multiple hotels with multiple hotel owners managing them.
Beyond Room Bookings
While Rooms right now is focused on just hotel nightly bookings we believe we can expand the core engine to handle both more fine-grained bookings (e.g. hours-based) as we well as larger bookings (e.g. minimum of a week).
Last but certainly not least we have a host of Drupal Rooms sites in the works. We will be sharing those (and the code so you can get a head-start with your own sites) before Drupalcon Portland - yes, I know in just a few days!
Drop us a line if you want to discuss any of the above. We are looking forward to helping people build their hotel/accomodation sites and the comments, feature requests and bug reports that we have been getting so far were instrumental to making Rooms a great booking solution.
Tags: Drupal RoomsDrupal PlanetDrupal Association News: Take Our Quick Survey on Webinar Topics
Last month, the Drupal Association launched a webinar series with the goal of providing more educational opportunities for the community. Our first webinar was on Spark and it was a great success with 500+ registrants. We are excited to do more!
But, as we mentioned in a previous blog post, before we move forward we want to hear from you. What topics do YOU want to learn about?
Personal blog tags: webinarsEchoDitto Tech Blog: Speed up PHP on NFS with turbo_realpath on CentOS
If you run a website based on PHP, and have your source files on a network file system like NFS, OCFS2, or GlusterFS, and combine it with PHP's open_basedir protection, you'll quickly notice that the performance will degrade substantially.
Normally, PHP can cache various path locations it learns after processing include_once and require_once calls via the realpath_cache. There's a bug in PHP that effectively disables the realpath_cache entirely when combined with open_basedir. Popular PHP applications with Drupal and WordPress make heavy use of these functions to include other files, so you would very quickly notice the drop in performance in this scenario. If you want to isolate your websites from each other (or from the rest of the operating system), how can you retain any shred of performance?
This is where Artur Graniszewski's turbo_realpath extension really comes in handy. I won't retype his installation instructions, so follow the previous link to get it installed manually.
If you're running CentOS 5 or CentOS 6, check out yum.echoditto.com and you'll find source and compiled RPMs that will install alongside the RedHat/CentOS-supplied PHP packages. The RPM will create a basic configuration file at /etc/php.d/turbo_realpath.ini. Essentially, it enables the PHP module but defaults all settings off, so you will need to read the comments (taken from Artur's most recent post on turbo_realpath) to determine how you want to use it.
ConfigurationWe frequently use turbo_realpath on a per-VirtualHost basis with Apache 2.2 and mod_php. If you use PHP-FPM, you can apply similar settings in your FPM pool configuration files. If you install our RPM and don't edit /etc/php.d/turbo_realpath.ini, add something similar to the following to each VirtualHost:
<IfModule php5_module> php_admin_value realpath_cache_basedir "/var/www/vhosts/domain.com:/usr/share/pear:/usr/share/php:/usr/lib64/php:/usr/lib/php:/tmp:/var/tmp" </IfModule>This is effectively the same using open_basedir; any directories referenced in realpath_cache_basedir will be the only ones the website is allowed to access, and they will be cached as determined by the realpath_cache_size and realpath_cache_ttl. If you look in php.ini, you may notice the default values for these are:
; Determines the size of the realpath cache to be used by PHP. This value should ; http://www.php.net/manual/en/ini.core.php#ini.realpath-cache-size ;realpath_cache_size = 16k ; Duration of time, in seconds for which to cache realpath information for a given ; http://www.php.net/manual/en/ini.core.php#ini.realpath-cache-ttl ;realpath_cache_ttl = 120You may want to increase these if you're finding your website is still not loading quickly. On our systems, we have bumped the realpath_cache_size and realpath_cache_ttl settings up to 1m and 300, respectively.
Speed and Security!With turbo_realpath enabled, realpath_cache_basedir set to appropriate open_basedir-like values, and realpath_cache_size and realpath_cache_ttl increased from defaults, we're able to have isolated PHP sites and have better performance by caching the locations of included/required files effectively. Hopefully, our RPMs will help you on your system for a quick installation of the excellent turbo_realpath module!
References- Running PHP on NFS: huge performance problems and one simple solution.
- Running PHP on NFS: new version of turbo_realpath extension
- Running PHP on NFS: version 1.2 of turbo_realpath extension
Image from iAmFreeman
LevelTen Interactive: Breaking up the Monolithic Drupal Site with a Subdomain Multisite
When building a Drupal website, do you ever notice that the site sometimes gets too complex and has too many modules installed? We run into this with clients that want a lot of features in their website such as commerce, forum, blog, knowledge base, and more.... Read more
Six Mile Tech: Entity Rules - Exposing Rules' power without Rules' complexity
The new Entity Rules module for Drupal provides a new way to associate Rule components with events for different entities such as users, nodes and taxonomy terms. This allows users who do not have access to the Rules UI to still configure when the Rule components are triggered for the Entity types that they can administer. It also allows this user to specify values for the parameters that are sent to these Rules components.
OpenSourcery: DrupalCon PDX: Pinball Pub Crawl!
As many of you know DrupalCon Portland is coming up in just a few short weeks. We here at OpenSourcery are very excited about this and we're looking forward to this rare opportunity to show off Portland to the greater Drupal community.
In fact we are so excited about DrupalCon PDX that we're going to be throwing a Pinball Pub Crawl Party along with Network Redux. What is a Pinball Pub Crawl you ask?
The party will be from 5-10pm Thursday May 23rd.
We'll start our evening off at OpenSourcery's offices where there will be free beer and free Hot Lips pizza. Greg Dunlap (heyrocker) will teach a brief "how to not suck at pinball" course (complete with special 'Pin Cam' AV projection technology) and you'll get a chance to put his advice into practice with free play on the four pinball machines at OpenSourcery. We'll also have foosball, ping pong, table games, a pinball tournament, and oh so much more!
But the night doesn't end there! Our free shuttle will then take you on to a Portland must – Ground Kontrol, a pinball and video game mecca for a private evening of free play from 7-10pm.
Feeling more like a walk? Those who wish can make the journey to Ground Kontrol on foot, stopping along the way at a few of Portland's best local bars, all of which have their own uniquely Portland character and pinball to boot.
If you're worried about getting here don't be! We will be running a free shuttle between the convention center, OpenSourcery, and Ground Kontrol from 4:30-10:30 pm! Tickets are free and can be reserved here.
Space is limited and we expect the party to fill up qucikly so reserve your spot now. Only guests who have signed up in advance will be allowed into OpenSourcery and Ground Kontrol on the event night. Sorry, this event is for 21+ attendees only.
Mike Crittenden: Making a Drupal bookmarklet
Last weekend I built/launched Frugalzon, which is a little hand-curated list of cool stuff on Amazon for $10 or less. (It's still new and fairly empty, but give it time!)
The Drupal site itself is simple--one content type, one view, one taxonomy, that's pretty much it. The only interesting aspect comes in the form of content entry. Since the whole point of the site is to be hand-picked items, I couldn't just pull some Amazon feed of cheap products. I had to manually add each of the items on there (and I continue to add a few items per day) by choosing stuff I think is cool. To make this easier, I made a bookmarklet that scrapes the info off of whatever Amazon product page I'm looking at and pre-populates a node add form on Frugalzon with that data.
So there are two things at work here: page scraping and prepopulation.
Page scrapingThe first part of the bookmarklet gathers up the relevant info on the Amazon product page I'm viewing. This includes:
- Title
- Price
- Prime shipping or regular
- Image URL
- Page URL (with my affiliate code added)
- Category
For finding this stuff, the easiest method is to just use your browser's dev tools. Inspect the elements to find a unique selector to match them, and then test it out in the console. This can get a little tricky sometimes depending on the markup, especially on a site like Amazon that has a few different possible product templates each with unique un-semantic markup.
Here's the JS in my bookmarklet that does all of this on Amazon.
var frugalzontitle = jQuery('h1').text().trim(); var frugalzonprice = jQuery('.a-color-price, .priceLarge').eq(0).text().trim().replace("$",""); var frugalzoncategory = jQuery('.nav-category-button').eq(0).text().trim().replace('All ', '').replace(',', ''); var frugalzonimage = jQuery('#holderMainImage img, #prodImageCell img').attr('src'); var frugalzonurl = document.URL; if (frugalzonurl.indexOf('?') > -1) { frugalzonurl += '&tag=frugalzon-20'; } else { frugalzonurl += '?tag=frugalzon-20'; } if (jQuery('#actualPriceExtraMessaging img').length > 0 || jQuery('#price img').length > 0) { frugalzonshipping = 'Prime'; } else { frugalzonshipping = 'Normal'; }As you can see, Amazon includes jQuery in the page so we can use that (yay!). If the site you're scraping doesn't, then you can either load it in noConflict mode or just use vanilla JS selector hotness. You might also notice that I'm prefixing all of my variable names with "frugalzon" as a poor man's way of namespacing this.
So now we have all the data we need...what do we do with it?
Node prepopulationThere's a cool module called Prepopulate that lets you pass data to the node/add/whatever page as a query string and that data will prepopulate the form. So for example, going to /node/add/product?edit[title]=Something would make the Title field have a default value of Something when the page loads.
This works great, but it can get a little hairy with different field types (Image URL, taxonomy term reference, plain text, etc.) because each field type has a different array path in the $form array in Drupal. Luckily, this is documented and all you have to do is view the source to see what the name attributes of your form elements look like to know what to pass.
In the end, here's what my JS looked like to build the URL to hit.
url = 'http://frugalzon.localhost/node/add/product?'; url += 'edit[title]=' + encodeURIComponent(frugalzontitle) + '&'; url += 'edit[field_price][und][0][value]=' + encodeURIComponent(frugalzonprice) + '&'; url += 'edit[field_url][und][0][value]=' + encodeURIComponent(frugalzonurl) + '&'; url += 'edit[field_category][und]=' + encodeURIComponent(frugalzoncategory) + '&'; url += 'edit[field_shipping][und]=' + encodeURIComponent(frugalzonshipping) + '&'; url += 'edit[field_image][und][0][filefield_remote][url]=' + encodeURIComponent(frugalzonimage) + '&'; window.open(url, '_blank');You'll notice that the Image field is passing in a URL which is handled via the filefield_sources module. Also, the Category field is a tag-style term reference field so whatever gets passed in there will be fine; you don't have to match up tid's to existing terms or anything.
Putting it all togetherSo now we have our bookmarklet code (here's a full gist) and we're set up to handle it on the Drupal side (using the Prepopulate module), so we just need to make an actual bookmarklet out of this thing.
I used this online tool for that. Paste in your JS and it'll crunch it and build a little link for you to drag to your bookmarks bar. This worked like a charm. Now, adding products to Frugalzon is as simple as clicking the bookmarklet on an Amazon product page and then clicking "Save" on the prepopulated node add form. Not bad!
Hey, maybe you should follow me on Twitter!
Trellon.com: New CRM Core Releases, and What to Expect
Today, Trellon released new versions of CRM Core and CRM Core Profile. Both of these modules include new features that are important for anyone looking to build modules that use CRM Core as a backend for storing contact information.
These releases are part of our Garden Party roadmap, as part of the 'Live Music' stage. They are for site builders and developers looking to build modules and features that expand upon CRM Core's basic capabilities. With them, you have some more powerful tools for working with contact records stored in your Drupal site, and they include some usability enhancements based on feedback we received as part of the 0.91 release of CRM Core.
I wanted to share a little about what you will find, and why it is important.
Acquia: Drupal Camp Scotland 2013 Double-Header
This week's podcast features two Drupal Scots: Duncan Davidson (recorded live in a back alley right after Drupal Camp Scotland 2013) and Brian Ward (recorded via Skype, post-event). Duncan is the Scottish regional manager and UK Professional Services Manager for i-KOS and Brian is a developer at heehaw.digital in Edinburgh.
duncan-n-brian_final.mp3Lullabot: Announcing Our 5th Annual DrupalCon Party
DrupalCon Portland will be happening in a few weeks and, as usual, Lullabot will be out in force. Our entire team will be there and we'll be spending our days training (4 classes) and presenting (8 sessions). We'll also be hanging out at both the Lullabot and Drupalize.Me booths in the exhibit hall. As usual, we've got a lot going on.
Drupal Association News: Sponsored blog post: Where should Drupal professionals focus for the next phase of growth?
As part of the Diamond and Platinum sponsorships for DrupalCon Portland, we've offered leaders at these sponsor companies the opportunity to guest blog on the Drupal Association site. In today's post, Robert Douglass of Commerce Guys takes a look at where Drupal is today, and the untapped opportunities for Drupal growth in e-commerce.
Personal blog tags: sponsor blogDrupalCon Portlandguest blogAten Design Group: Project Review Wednesday: Content Reminder
There are currently 98 new Drupal contributors awaiting review of their first project. This is a great place to contribute to the community and learn about interesting upcoming projects, for example...
Module: Content Reminder What does it do?Publishing content feels great. There's a sense of accomplishment and it's there for the world to see. However, that content oftentimes needs to be checked on and updated. Instead of letting a page languish, alone and forgotten, you can use the Content Reminder module to set up reminders to check on it.
Content Reminder adds a notification tab to each node, allowing a user to create a notification to be sent to a site's user with a customizable message and date upon which it should be sent. Now you can ensure that your site's content is fresh and relevant, not forgotten.
Zoom Look Useful? Review it!If you would like to see this module readily available on Drupal.org, you should review it and help make that happen.
Pro Tip: If you've never reviewed a project application before, you can find instructions for reviewers on Drupal.org and the Code Review group is happy to help more people get involved.
Pronovix: Drupal for the European Commission: BoFSession at DrupalCon Portland 2013
This is a guest post by Mathew Lowry from Intrasoft International. We suggested him to write this post as a preparation for a BoF session his colleague will be organizing at DrupalCon Portland. If you are working on a Drupal platform for government or for a bigger organization that wants to standardize on Drupal as a communication platform for a series of its departments, and if you are attending Drupalcon Portland, come and join us to discuss best practices and lessons learned.
Acquia: Notes from Views Mini-Course, Part II: Creating Flexible Views with Drupal
Here are notes from the 2nd class in our Views mini-course.
Microserve: Drupal.org - Contributing a Module & The Review Process
I recently went through the process of contributing my first Drupal 7 module, and while the process isn't too hard there were many things that would have been helpful to know at the start rather than finding out half way through the process. As a result of my experiences I've decided to put together this blog which covers many of the common pitfalls people run into and provides a collection of useful links to various bits of documentation on Drupal.org.
How It WorksWhen you first register at drupal.org you will only be able to create sandbox projects, once you've created your first sandbox project you will be able to apply for full project access. Applying for full project access means your sandbox project will have to go through a review by the community, once that's approved you will gain full project access and wont have to get any future projects reviewed.
Getting StartedThe first thing you'll need is an idea of what the module you want to create will do, once you've come up with the idea check that there aren't existing modules that do the same thing and make sure what you are trying to do should be in its own module and not just part of another existing module. If your module is too similar to an existing module then your project application will be declined, and any hard work you've put into the module will have gone to waste. For more information on duplicate modules see collaboration rather than competition.
Creating a Sandbox ProjectCreating a Sandbox project is fairly straight forwards, but be sure to check out tips for a great project page or for even more project page tips How to make your module description useful. Your project application may be delayed if the description of your project isn't sufficiently detailed.
When setting up Git for your new sandbox project if you follow the instructions provided you will end up with a master branch, unfortunately this isn't actually correct, Drupal requires that you work out of a major version branch (7.x-1.x for example) instead of master. You will need to change this before your project goes for review, read through Moving from a master to a major version branch to find out how to do this.
Coding Your ProjectGetting your code to meet the standards expected by Drupal is quite easy, it does however involve reading through a lot of documentation, these are the bits I found most useful:
- Coding standards
- Commenting standards
- Writing secure code
- Module documentation guidelines (also see README files)
Once you've read through the above and written some code there are some handy tools available to check that your code complies with Drupal's standards:
- The Coder module which checks your module code on your local Drupal installation.
- ventral.org which can be used to test your code once it has been pushed to the repository on drupal.org.
If either of the above tools pick up any errors they will be brought up in your project application, and you will be expected to fix them however trivial they may seem.
Applying for Full Project Access
Before you apply make sure you check that the sandbox module you are going to apply with meets all of the requirements listed in the Project application checklist, also note you can only apply for full project access with one sandbox module.
When you're ready to apply for full project access read Apply for permission to create full projects for guidance. Once you've done this you will need to obtain a review bonus. Although the documentation suggests obtaining a review bonus is optional in practice, it truly isn't if you want your module to be reviewed in any sensible amount of time.
To get the review bonus you will need to review three other modules, see Review bonus for guidance on how to do this. Make sure that your review of the other modules is sufficiently detailed as your review will not be counted if it's just a copy of the results from ventral.org.
Once you have your review bonus add the tag and you should find your module being reviewed shortly after. Note though if any major issues are found you will not only have to fix them but will have to re-earn your review bonus so it's well worth reading the standards documentation etc... beforehand as it will probably save you time in the long run.
Good luck with your module!
LevelTen Interactive: Using Drupal 7 Entity Reference to help Create User Dashboards
Over the years, I have noticed a significant increase in the need for businesses to create user dashboards from which their customers are provided account details, up-to-date reports, downloadable documents and other important information. As more clients ask for user-driven websites that provide user-specific information, the need to relate or reference various types of content/data together is becoming commonplace.... Read more
Drupal Easy: DrupalEasy Podcast 105: Men in Tights
Bob Kepford (kepford) from The Weekly Drop joins Andrew Riley, Ted Bowman, and Mike Anello to talk about how Bob mines nuggets of Drupal goodness from the weekly Drupal firehose. Other topics discussed include Panopoly, open-source project statistics, the impending Google Reader apocalypse, Open Atrium 2.x, and a bunch of other mostly Drupal-related topics.
